Skip to content

Instantly share code, notes, and snippets.

@laaptu
Created December 4, 2013 07:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laaptu/7783545 to your computer and use it in GitHub Desktop.
Save laaptu/7783545 to your computer and use it in GitHub Desktop.
Device Screen Width Height
WindowManager windowManager =(WindowManager)getSystemService(Context.WindowService);
DisplayMetrics displayMetrics = new DisplayMetrics();
windowManager.getDefaultDisplay().getMetrics(displayMetrics);
int screenWidth = displayMetrics.widthPixels;
int screenHeight = displayMetrics.heightPixels;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment