Java tutorial
//package com.java2s; import android.annotation.SuppressLint; import android.app.Activity; import android.os.Build; import android.view.View; import android.view.WindowManager; public class Main { @SuppressLint("InlinedApi") public static void makeFullscreen(Activity activity) { // if (!SkyUtility.isNexus()) return; // if (SkyUtility.isNexusTablet()) return; activity.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); if (Build.VERSION.SDK_INT >= 19) { activity.getWindow().getDecorView() .setSystemUiVisibility(View.SYSTEM_UI_FLAG_IMMERSIVE | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); } else if (Build.VERSION.SDK_INT >= 11) { activity.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE); } } }