public void HideNavbar() { if(Build.VERSION.SDK_INT < 19) //API 18 or below View v = this.getWindow().getDecorView(); v.setSystemUiVisibility(View.GONE); } else { //API 19 or above View decorView = getWindow().getDecorView(); int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY; decorView.setSystemUiVisibility(uiOptions); } }