Example usage for android.app Activity getWindowManager

List of usage examples for android.app Activity getWindowManager

Introduction

In this page you can find the example usage for android.app Activity getWindowManager.

Prototype

public WindowManager getWindowManager() 

Source Link

Document

Retrieve the window manager for showing custom windows.

Usage

From source file:Main.java

public static int getHeight(Activity activity) {
    return activity.getWindowManager().getDefaultDisplay().getHeight();
}

From source file:Main.java

public static int getScreenWidth(Activity context) {
    context.getWindowManager().getDefaultDisplay().getMetrics(metric);
    return metric.widthPixels;

}

From source file:Main.java

public static int getWidth(Activity activity) {
    return activity.getWindowManager().getDefaultDisplay().getWidth();
}

From source file:Main.java

public static int getScreenWidth(Activity activity) {
    return activity.getWindowManager().getDefaultDisplay().getWidth();
}

From source file:Main.java

public static int getScreenHeight(Activity activity) {
    return activity.getWindowManager().getDefaultDisplay().getHeight();
}

From source file:Main.java

public static int getDisplayWidth(Activity act) {
    return act.getWindowManager().getDefaultDisplay().getWidth();
}

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 getScreenWidth(Activity a) {
    Display display = a.getWindowManager().getDefaultDisplay();
    int width = display.getWidth(); // deprecated

    return width;
}

From source file:Main.java

public static Display getScreenDisplay(Activity act) {
    Display display = act.getWindowManager().getDefaultDisplay();

    return display;
}

From source file:Main.java

public static int getRotation(Activity context) {
    return context.getWindowManager().getDefaultDisplay().getRotation();
}