Search This Blog

Friday, August 2, 2013

Android 4.0 and up - How to properly get (active) display dimensions

WindowManager wm = (WindowManager) getApplicationContext().getSystemService(Context.WINDOW_SERVICE);
Display display = wm.getDefaultDisplay();
Point displaySize = new Point();
display.getSize(displaySize);
int width = displaySize.x;
int height = displaySize.y;


1 comment:

If you like this post, please leave a comment :)