Note that there are some explanatory texts on larger screens.

plurals
  1. POListen for first TouchEvent when using SYSTEM_UI_FLAG_HIDE_NAVIGATION
    primarykey
    data
    text
    <p>Starting with API 14 you can use this flag <code>SYSTEM_UI_FLAG_HIDE_NAVIGATION</code> on a View within your Activity to tell the system you want to hide the navigation bar until there is user interaction (screen touch). Once the user taps the screen the bar is shown.</p> <p>The Activity that I am doing this in takes some action (starts a separate activity) when the user touches the screen, before adding the above flag to my view this worked perfectly. </p> <p>After adding that flag the system intercepts the first screen touch and reacts to it by showing the nav bar. It's not until the second touch that any of my Views, or my Activity are receiving a TouchEvents.</p> <p>Does anyone know of a way that I can set up a listener that will let me launch my second activity the first time the screen is touched instead of needing to double tap when using this hide nav flag?</p> <p>I've tried all of the following and I'm not getting callbacks to any of them when the screen is touched for the first time to show the nav bar.</p> <pre><code>@Override public void onUserInteraction(){ Log.i(myTag, "INTERACT"); } @Override public boolean onGenericMotionEvent(MotionEvent me){ Log.i(myTag, "GENERIC"); return true; } //I thought maybe the size change would lead to a callback here. No dice though. @Override public void onWindowAttributesChanged(WindowManager.LayoutParams params){ Log.i(myTag, "WINDOW CHANGE"); } @Override public boolean dispatchTouchEvent(MotionEvent me){ Log.i(myTag, "TOUCH"); return true; } </code></pre> <p>Note: I am not trying to prevent the nav bar from being shown upon the first touch, I just want to also take some other action when that event occurs.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload