title: Android OnSystemUiVisibilityChangeListener fires in Portrait only
body: <p>I'm trying to hide navigation bar in my full-screen Android app as <a href="https://developer.android.com/training/system-ui/navigation.html" rel="nofollow">this document</a> describes. This works, but only in portrait orientation(*). If the app rotates to landscape, the <code>OnSystemUiVisibilityChangeListener</code> stops firing. If the app then rotates back to portrait, <code>OnSystemUiVisibilityChangeListener</code> starts firing again. I tried to call this code from <code>onCreate()</code> and from <code>onResume()</code>, and the effect is the same.</p>
  
  <pre><code>final View decor=getWindow().getDecorView();
  decor.setOnSystemUiVisibilityChangeListener (new View.OnSystemUiVisibilityChangeListener() {
      public void onSystemUiVisibilityChange(int visibility) {
          android.util.Log.d("d", "onSystemUiVisibilityChange");
          new Handler().postDelayed(new Runnable() {
              public void run(){
                  decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
              }
          }, 1500);
      }
  });
  decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
  </code></pre>
  
  <p>(*) It works in whatever orientation the app starts in--if the app starts in landscape, the listener fires only in landscape, if the app starts in portrait, the listener only fires in landscape.</p>