Get the real screen resolution on Ice Cream Sandwich

点点圈 提交于 2019-11-30 12:35:12

The API returns the number of pixels an app can use, so this is the correct result.

From API level 17 (Android 4.2 Jelly Bean), you can get the real size of the display as follows:

Point size = new Point();
Display display = getWindowManager().getDefaultDisplay();
display.getRealSize(size);

size will now contain the display size based on the orientation (ie. x will be left/right relative to the user, not the device)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!