Android之获取手机屏幕分辨率

public static int[] getScreenDispaly(Context context) {
  WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
  int width = windowManager.getDefaultDisplay().getWidth();// 手机屏幕的宽度
  int height = windowManager.getDefaultDisplay().getHeight();// 手机屏幕的高度
  int result[] = { width, height };
  return result;
}

原文地址:https://www.cnblogs.com/awandxx/p/5283864.html