DisplayMetrics dm;
dm = new DisplayMetrics();
WindowManager wm = getContext().getWindowManager();
wm.getDefaultDisplay().getMetrics(dm);
int w = dm.widthPixels;
int h = dm.heightPixels;
转载于:https://www.cnblogs.com/benniao/p/4572214.html
DisplayMetrics dm;
dm = new DisplayMetrics();
WindowManager wm = getContext().getWindowManager();
wm.getDefaultDisplay().getMetrics(dm);
int w = dm.widthPixels;
int h = dm.heightPixels;
转载于:https://www.cnblogs.com/benniao/p/4572214.html