Inside Activity
Display display = getWindowManager().getDefaultDisplay();
Point size = new Point();
display.getSize(size);
int width = size.x;
int height = size.y;
System.out.println("width = " + width + ", height = " + height);
I/System.out( 2318): width = 1280, height = 752
Note that this gives you available display size without the top bar.
I/System.out( 1900): width = 1004, height = 654
No comments:
Post a Comment