Android Screen Full Screen Set toggleFullScreen(Activity activity, boolean isFull)

Here you can find the source of toggleFullScreen(Activity activity, boolean isFull)

Description

toggle Full Screen

Declaration

public static void toggleFullScreen(Activity activity, boolean isFull) 

Method Source Code

//package com.java2s;

import android.app.Activity;

import android.view.Window;
import android.view.WindowManager;

public class Main {
    public static void toggleFullScreen(Activity activity, boolean isFull) {
        Window window = activity.getWindow();
        WindowManager.LayoutParams winParams = window.getAttributes();
        final int bits = WindowManager.LayoutParams.FLAG_FULLSCREEN;
        if (isFull) {
            winParams.flags |= bits;// w w w  .j a  v  a 2 s. co  m
        } else {
            winParams.flags &= ~bits;
        }
        window.setAttributes(winParams);
    }
}

Related

  1. requestFullscreen(final Activity pActivity)
  2. requestFullscreen(final Activity pActivity)
  3. setFullScreen(Activity activity)
  4. setFullScreen(Activity activity)
  5. setupFullScreen(Window window)