Java tutorial
//package com.java2s; //License from project: Apache License 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; } else { winParams.flags &= ~bits; } window.setAttributes(winParams); } }