0

On the first start of my app I start an Intro-Activity in fullscreen with hidden navigation bar (black bar at the bottom) with:

View decorView = getWindow().getDecorView();
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);

The Activity contains a Button to close it.

My problem is: with hidden navigation bar, the first tap on the close-button does not trigger the button, but reveals the navigation bar, only the second tap triggers the button.

Is there a way how I can close the Activity on first button tap?

fweigl
  • 21,278
  • 20
  • 114
  • 205

1 Answers1

0

The answer is described here- https://developer.android.com/training/system-ui/immersive.html. There's a new flag SYSTEM_UI_FLAG_IMMERSIVE that allows this. Unfortunately its KitKat and above only- older phones do not have the capability.

Gabe Sechan
  • 90,003
  • 9
  • 87
  • 127