Issue 1: 获取屏幕分辨率(不需要适配API level)
DisplayMetrics dm = new DisplayMetrics();
activity.getWindowManager().getDefaultDisplay().getMetrics(dm);
mScreenW = dm.widthPixels;
mScreenH = dm.heightPixels;
转载于:https://www.cnblogs.com/peak2013/p/4515412.html