public static int displayWidth; //屏幕宽度 public static int displayHeight; //屏幕高度
DisplayMetrics displayMetrics = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(displayMetrics); displayWidth = displayMetrics.widthPixels; displayHeight = displayMetrics.heightPixels;
记录一下