获取屏幕的宽度和高度:
//获取屏幕的宽度 public static int getScreenWidth(Context context) { WindowManager manager = (WindowManager) context .getSystemService(Context.WINDOW_SERVICE); Display display = manager.getDefaultDisplay(); return display.getWidth(); } //获取屏幕的高度 public static int getScreenHeight(Context context) { WindowManager manager = (WindowManager) context .getSystemService(Context.WINDOW_SERVICE); Display display = manager.getDefaultDisplay(); return display.getHeight(); }
android之获取屏幕的宽度和高度,布布扣,bubuko.com
原文:http://blog.csdn.net/u014608640/article/details/24346503