title: Status bar is hidden under fullscreen but it shows up when menu key pressed in Android
body: <p>I have an App containing a toggle FullScreen function.<br>
  It did success to toggle fullscreen using the following code.<br></p>
  
  <pre><code>    if (tofull) {
  
          if (Build.VERSION.SDK_INT &lt; 16) {
              Log.i("toggleFullScreen", "API&lt;16");
              getWindow().setFlags(
                      WindowManager.LayoutParams.FLAG_FULLSCREEN,
                      WindowManager.LayoutParams.FLAG_FULLSCREEN);
          } else {
              Log.i("toggleFullScreen", "API&gt;=16");
              View decorView = getWindow().getDecorView();
              // Hide the status bar.
              // int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
              int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN
                      | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
              decorView.setSystemUiVisibility(uiOptions);
          }
  
      } else {
          if (Build.VERSION.SDK_INT &lt; 16) {
              Log.i("toggleFullScreen", "API&lt;16");
              getWindow().clearFlags(
                      WindowManager.LayoutParams.FLAG_FULLSCREEN);
          } else {
              Log.i("toggleFullScreen", "API&gt;=16");
              View decorView = getWindow().getDecorView();
              // Hide the status bar.
              int uiOptions = View.SYSTEM_UI_FLAG_VISIBLE;
              decorView.setSystemUiVisibility(uiOptions);
          }
      }
  </code></pre>
  
  <p>It can hide status bar after toggled to fullscreen mode.<br></p>
  
  <p>However, when I pressed <strong>hardware menu key</strong> button (I have an options menu which will show up after menu key pressed), the <strong>status bar comes out</strong>. And status bar <strong>does not hide again</strong>.</p>
  
  <p>What will be the possible reason for this problem exists?<br>
  Could anyone solve it(make the status bar hide again automatically)?</p>