0

In styles I've

<item name="android:windowFullscreen">true</item>
<item name="android:windowNoTitle">true</item>

and in the manifest file, in application I've specified my theme, but home button and back button are still visible, what should I do?

misha
  • 134
  • 1
  • 10

2 Answers2

1

You must use Immersive feature of android. Immersive mode will be only working on devices with KitKat and higher. This, what is weird on your side, is fact, that basing on your words, you cannot even get these flags like this:

View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;

(or part of them). If it is this way, then it is looking, that your compileSdkVersion is lower, than it should be. On start I would advise you to update compileSdkVersion.

When you will do this, and you would like to use these flags please in places, where you want to use immersive mode add conditions, that will be looking like this:

if (Build.VERSION.SDK_INT >= VERSION_CODES.KITKAT) {
    int UI_OPTIONS = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;
    getWindow().getDecorView().setSystemUiVisibility(UI_OPTIONS);
}

Then it should not mess on older OS.

W4R10CK
  • 5,502
  • 2
  • 19
  • 30
0

Use the following two way to achieve what you need

  • getActionBar().setDisplayHomeAsUpEnabled(false) to remove the home button from the action bar.
  • ActionBar().setHomeAsUpIndicator(null); getSupportActionBar().setHomeAsUpIndicator(null); i prefer you use the first 1
  • make sure your activity is declaired as and in style you specify the style as ~~ – Amith Kr Sep 16 '16 at 08:46