@ SuppressLint ( "NewApi" ) public static Point getDisplaySize ( WindowManager manager ) { Display display = manager . getDefaultDisplay ( ) ; if ( Build . VERSION . SDK_INT > Build . VERSION_CODES . HONEYCOMB_MR2 ) { Point size = new Point ( ) ; display . getSize ( size ) ; return size ; } else { Point size = new Point ( ) ; size . x = getDisplayWidth ( manager ) ; size . y = getDisplayHeight ( manager ) ; return size ; } }
Get the display width and height .