I use immersive-sticky mode to hide the navigation bar and action bar:
@TargetApi(19)
private void setImmersiveMode() {
if (Build.VERSION.SDK_INT >= 19) {
View decorView = getWindow().getDecorView();
int uiOptions = getImmersiveUiOptions(decorView);
decorView.setSystemUiVisibility(uiOptions);
ActionBar actionBar = getActionBar();
if (null!=actionBar) {
actionBar.hide();
}
}
}
When a Spinner
is touched, the navigationBar
is shown and immersive mode is disabled.
This solution works for Dialogs:
dialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE);
dialog.show();
dialog.getWindow().getDecorView().setSystemUiVisibility(
context.getWindow().getDecorView().getSystemUiVisibility());
dialog.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE);
But Spinner
doesn't have show()
method that I could overwrite.
How can I prevent System UI from showing when a Spinner is touched?
Edit: this question is about keeping the Navigation Bar hidden (BackButton, HomeButton and RecentTasksButton). I'm already using FLAG_FULLSCREEN
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);