@SuppressWarnings("deprecation")
    @SuppressLint("NewApi")
    public static int getScreenHeight(Activity context) {

        Display display = context.getWindowManager().getDefaultDisplay();
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {
            Point size = new Point();
            display.getSize(size);
            return size.y;
        }
        return display.getHeight();
    }
@ SuppressWarnings ( "deprecation" ) @ SuppressLint ( "NewApi" ) public static int getScreenHeight ( Activity context ) { Display display = context . getWindowManager ( ) . getDefaultDisplay ( ) ; if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . HONEYCOMB_MR2 ) { Point size = new Point ( ) ; display . getSize ( size ) ; return size . y ; } return display . getHeight ( ) ; }
Get the screen height.

@param context
@return the screen height