How can I get android Honeycomb system's screen width and height?
I think Display.getHight was include SystemBar.
I have confirmed the following things in NexusS and Xoom.
1 2 3 4 5 6 7 8 9 10 11 | Display display = getWindowManager().getDefaultDisplay(); DisplayMetrics displayMetrics = new DisplayMetrics(); display.getMetrics(displayMetrics); Log.e( "" , "------------------ " ); Log.e( "" , "display.getHeight() = " + display.getHeight()); Log.e( "" , "display.getWidth() = " + display.getWidth()); Log.e( "" , "------------------ " ); Log.e( "" , "displayMetrics.heightPixels = " + displayMetrics.heightPixels); Log.e( "" , "displayMetrics.widthPixels = " + displayMetrics.widthPixels); Log.e( "" , "------------------ " ); |
Results were as follows:
Nexus S
display.getHeight() = 800
display.getWidth() = 480
Xoom
display.getHeight() = 752
display.getWidth() = 1280
Xoom will not include status bar height.
getHeight() is include statusbar in GingerBread, not in Honeycomb.
No comments:
Post a Comment