title: KEYCODE_BACK doesn't work when pressed for the very first time
body: <p>I'm having trouble overriding the Back Button press on Android.</p>
  
  <p>The thing is, everything works perfectly except for the very first time.
  When I load the app and press the back button for the first time, it pauses the app, which is NOT what I want. Other than that, it works as expected.</p>
  
  <p>My code:</p>
  
  <pre><code>private void setupDeviceButtons(){ // this is ran at the very beginning (onViewCreated())
          // setting up a listener to close the menus when the back button is pressed
          View view = getView();
  
          Log.e(TAG, "This happens when I load the app" );
  
          if (view != null) {
  
              Log.e(TAG, "This also happens when I load the app");
  
              view.setOnKeyListener((v, keyCode, event) -&gt; {
                  if (keyCode == KeyEvent.KEYCODE_BACK) {
  
                      Log.e(TAG, "But this doesn't happen when I press the back button for the first time.");
  
                      // we filter all actions that are not key down
                      if (event.getAction() != KeyEvent.ACTION_DOWN)
                          return true;
  
                      ...
  
                  }
                  return false;
              });
          } else {
              Log.e(TAG, "ERROR on setupDeviceButtons(): Unable to set back button behaviour. View is null.");
          }
      }
  </code></pre>
  
  <p>Any thoughts?</p>
  
  <p>Thank you in advance</p>