Android中获得屏幕的宽度和高度
Android获得屏幕的宽度和高度很简单,只需在Activity中调用以下代码:
int screenWidth;//屏幕宽度
int screenHeight;//屏幕高度
WindowManager windowManager = getWindowManager();
Display display = windowManager.getDefaultDisplay();
screenWidth = display.getWidth();
screenHeight = display.getHeight();