Few words for background: Application will be used in exhibition. It should hide home, back, appswitcher buttons and notification bar to prevent user to go settings etc.
Device: Samsung GT-N8000 Android 4.1.2
I have tried to hide them by SYSTEM_UI_FLAG_HIDE_NAVIGATION.
AndroidManifest.xml
android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen"
MainActivity.java
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
View decorView = getWindow().getDecorView();
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
setContentView(R.layout.activity_main);
}
Applicaiton is hiding them when it starts. Everything is fine. But when I make touch on screen, buttons and notificaiton bar is coming out to the bottom of screen.
UPDATE: TRIED TO SOLVE THIS BY onTouchEvent
@Override
public boolean onTouchEvent(MotionEvent event) {
// TODO Auto-generated method stub
View decorView = getWindow().getDecorView();
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
return true;
}
Result: Touch->Navigation is opening, Touch->Navigation is hiding :( How to hide buttons and notification bar totally(forever)?