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 GetOrientation(Activity act) {
    return act.getWindowManager().getDefaultDisplay().getRotation();
}

From source file:Main.java

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

From source file:Main.java

public static int getdensityDpi(Activity context) {
    context.getWindowManager().getDefaultDisplay().getMetrics(metric);
    return metric.densityDpi;
}

From source file:Main.java

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

From source file:Main.java

public static int getScreenWidth(Activity activity) {
    activity.getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
    return displayMetrics.widthPixels;
}

From source file:Main.java

public static int getScreenHeight(Activity activity) {
    activity.getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
    return displayMetrics.heightPixels;
}

From source file:Main.java

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

From source file:Main.java

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

From source file:Main.java

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

From source file:Main.java

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