Android开发获取屏幕的大小
在Activity里取得屏幕大小
DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm);
int height = dm.heightPixels;
int width = dm.widthPixels;
另一种方法
Display display = ((WindowManager)getSystemService(WINDOW_SERVICE)).getDefaultDisplay();
int height = display.getHeight();
int width = display.getWidth();