DisplayMetrics dm; dm = new DisplayMetrics(); WindowManager wm = getContext().getWindowManager(); wm.getDefaultDisplay().getMetrics(dm); int w = dm.widthPixels; int h = dm.heightPixels;
android 获取屏幕宽高最新方法
原文:http://www.cnblogs.com/benniao/p/4572214.html