I would like to use the Immersive Full-Screen Mode in my app.
I have no problem entering the mode, but when I start the next Activity
it is gone.
I fixed this by creating my own Activity
-class which extends AppCompatActivity
and overloads onCreate(...)
with
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
}
All my other Activities
now extend this class.
Is there a better way to do this?