Code example for Point

Methods: getSize

0
		selfstyle.setColor(Color.BLUE);
		 
		 
		 
		/*Get Window dimensions*/ 
		Point size = new Point();
		WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
		if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB){
		      wm.getDefaultDisplay().getSize(size);
		      screenwidth = size.x;
		      DisplayMetrics metrics = new DisplayMetrics();
		      wm.getDefaultDisplay().getMetrics(metrics);
		       
 
		      switch (metrics.densityDpi) {
		          case DisplayMetrics.DENSITY_HIGH:
		              Log.i("display", "high");
		              screenheight = size.y - 48;
		              break; 
		          case DisplayMetrics.DENSITY_MEDIUM:
Contextual code suggestions in your IDE  Get Codota for Java