onTouchEvent() will not be triggered if setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION) is invoked
android
Solution
Android 4.4 (API Level 19) introduces a new `SYSTEM_UI_FLAG_IMMERSIVE` flag for `setSystemUiVisibility()` that lets your app go truly "full screen." This flag, when combined with the `SYSTEM_UI_FLAG_HIDE_NAVIGATION` and `SYSTEM_UI_FLAG_FULLSCREEN` flags, hides the navigation and status bars and lets your app capture all touch events on the screen.
Problem
I call ``` getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION) ``` when my app starts to make my app able to display the full screen. I want my app's UI to pop up when screen is touched, but `Activity.onTouchEvent()` is not triggered until the screen is touched a second time. At first touch, only the Virtual Keys are shown. So, I have to trigger my app's UI to pop up on ``` public void onSystemUiVisibilityChange(int visibility) { if (visibility == View.SYSTEM_UI_FLAG_VISIBLE) { // show my APP UI } } ``` but `onSystemUiVisibilityChange` with `View.SYSTEM_UI_FLAG_VISIBLE` will be invoked NOT once per touch (3 times on my Galaxy Nexus) by system, especially if the user touches the screen very fast/often. project lib 4.0 or 4.03. Samsung galaxy(9250) with 4.03.