Example usage for android.view Display getHeight

List of usage examples for android.view Display getHeight

Introduction

In this page you can find the example usage for android.view Display getHeight.

Prototype

@Deprecated
public int getHeight() 

Source Link

Usage

From source file:Main.java

public static float getWindowHeight(Context context) {
    WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
    Display display = wm.getDefaultDisplay();
    return display.getHeight();
}

From source file:Main.java

public static int getScrHeight(Context context) {
    WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
    Display display = wm.getDefaultDisplay();
    return display.getHeight();
}

From source file:Main.java

public static int getWindowHeight(Context context) {
    WindowManager manager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
    Display display = manager.getDefaultDisplay();
    return display.getHeight();
}

From source file:Main.java

public static int getScreenHeight(Activity activity) {
    WindowManager manager = activity.getWindowManager();
    Display display = manager.getDefaultDisplay();
    return display.getHeight();
}

From source file:Main.java

@SuppressWarnings("deprecation")
public static int getScreenHeight(Context context) {
    WindowManager manager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
    Display display = manager.getDefaultDisplay();
    return display.getHeight();
}

From source file:Main.java

public static int getScreenHeight(Activity a) {
    Display display = a.getWindowManager().getDefaultDisplay();
    return display.getHeight();
}

From source file:Main.java

public static int getScreenHeight(Context context) {
    WindowManager manager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
    Display display = manager.getDefaultDisplay();
    return display.getHeight();
}

From source file:Main.java

public static String getResolution(Context context) {
    WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
    Display display = wm.getDefaultDisplay();
    return display.getWidth() + "*" + display.getHeight();
}

From source file:Main.java

private static int getDisplayHeight(Activity activity) {
    Display display = activity.getWindowManager().getDefaultDisplay();
    return display.getHeight();
}

From source file:Main.java

/**
 *
 * @param activity//from ww w .j  a  v a  2s  .co m
 * @return
 */
public static int getDisplaySmallerSideSize(Activity activity) {
    Display display = activity.getWindowManager().getDefaultDisplay();
    return Math.min(display.getHeight(), display.getWidth());
}