Example usage for android.app Activity getWindow

List of usage examples for android.app Activity getWindow

Introduction

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

Prototype

public Window getWindow() 

Source Link

Document

Retrieve the current android.view.Window for the activity.

Usage

From source file:Main.java

public static void showSystemUI(Activity act) {
    act.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
            | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
}

From source file:Main.java

public static void fullScreen(Activity act) {
    act.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
}

From source file:Main.java

public static void setFormat(Activity activity) {
    activity.getWindow().setFormat(1);
}

From source file:Main.java

public static void showKeyboard(Activity activity) {
    activity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
}

From source file:Main.java

public static void showStatusBar(Activity activity) {
    activity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
}

From source file:Main.java

public static void closeBarByCode(Activity activity) {
    activity.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
}

From source file:Main.java

public static void hideInput(Activity activity) {
    activity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
}

From source file:Main.java

public static Bitmap capture(Activity act) {
    act.getWindow().getDecorView().setDrawingCacheEnabled(true);
    Bitmap bmp = act.getWindow().getDecorView().getDrawingCache();
    return bmp;//from www.j a  va  2s.  c  om
}

From source file:Main.java

public static void setHideSoftKeyboard(Activity activity) {
    activity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
}

From source file:Main.java

public static void adjustSoftInput(Activity activity) {
    activity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
}