Monday, October 3, 2011

Android: Screen dimensions and orientation


/* get display from WindowManager */
Display display = ((WindowManager) getSystemService(WINDOW_SERVICE)).getDefaultDisplay();
           
/* get infos */
int width = display.getWidth();
int height = display.getHeight();
int orientation = display.getOrientation();

No comments: