Example usage for android.content Context WINDOW_SERVICE

List of usage examples for android.content Context WINDOW_SERVICE

Introduction

In this page you can find the example usage for android.content Context WINDOW_SERVICE.

Prototype

String WINDOW_SERVICE

To view the source code for android.content Context WINDOW_SERVICE.

Click Source Link

Document

Use with #getSystemService(String) to retrieve a android.view.WindowManager for accessing the system's window manager.

Usage

From source file:Main.java

public static int getWidthScreen(Context context) {
    Display display = ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
    return display.getWidth();
}

From source file:Main.java

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

From source file:Main.java

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

From source file:Main.java

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

From source file:Main.java

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

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 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 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

public static int getWidth(Context context) {
    WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
    return wm.getDefaultDisplay().getWidth();
}

From source file:Main.java

public static int getWidth(Context context) {
    WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
    DisplayMetrics outMetrics = new DisplayMetrics();
    wm.getDefaultDisplay().getMetrics(outMetrics);
    return outMetrics.widthPixels;
}