title: How to keep hiding bottom navigation bar when SearchView is touched/focused or Dialog is showed/focused - AndroidStudio/Java
body: <p>I call this function in onCreate of every activity of my app project:</p>
  <pre><code>public void hideDeviceBottomNav ()
  {
      View decorView = getWindow().getDecorView();
  
      final int flags = 
        View.SYSTEM_UI_FLAG_LAYOUT_STABLE
      | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
      | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
      | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
      | View.SYSTEM_UI_FLAG_FULLSCREEN
      | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
  
      decorView.setSystemUiVisibility(flags);
  
      decorView.setOnSystemUiVisibilityChangeListener
              (new View.OnSystemUiVisibilityChangeListener() {
                  @Override
                  public void onSystemUiVisibilityChange(int visibility) {
                      // Note that system bars will only be &quot;visible&quot; if none of the
                      // LOW_PROFILE, HIDE_NAVIGATION, or FULLSCREEN flags are set.
                      if ((visibility &amp; View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) {
                          // TODO: The system bars are visible. Make any desired
                          // adjustments to your UI, such as showing the action bar or
                          // other navigational controls.
                          decorView.setSystemUiVisibility(flags);
                      } else {
                          // TODO: The system bars are NOT visible. Make any desired
                          // adjustments to your UI, such as hiding the action bar or
                          // other navigational controls.
  
                      }
                  }
              });
  }
  </code></pre>
  <p>and still every time I touch the search icon in my SearchView to search in my ListView or create and show new custom Dialog, the bottom navigation bar appears... .</p>
  <p>In addition, how can I hide the bottom navigation only without hiding the upper bar ?</p>