private static Point getScreenSize ( Context context , Point p ) { if ( p == null ) { p = new Point ( ) ; } WindowManager windowManager = ( WindowManager ) context . getSystemService ( Context . WINDOW_SERVICE ) ; Display display = windowManager . getDefaultDisplay ( ) ; display . getSize ( p ) ; return p ; }
Returns screen height and width