I need to completely remove the actionbarr and navigationbar from my app. So I stay in fullscreen without the possibility to swipe so I get the navigationbar back.
I have now this code in my onreate method which makes it go away but as soon as you swipe the navigation bar will appear again. How can I avoid this?
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);
On your activity override onBackPressed() to prevent activity from going back when back button is pressed. By default it runs finish() method if there is no backStack to run through.
On your App theme for the activity, make sure it's a theme that has NoActionBar on it that way it won't have one unless you put one into layout.