title: What key gets pressed to hide soft keyboard in android
body: <p>I'm trying to detect when the soft keyboard gets closed, I found this code snippet</p>
  <pre><code>@Override
  public boolean onKeyPreIme(int keyCode, KeyEvent event) {
     if (event.getKeyCode() == KeyEvent.KEYCODE_BACK){
            //detects that keyboard was hidden
         }
         return super.onKeyPreIme(keyCode, event);
     }
  </code></pre>
  <p>but this needs to be added to a subclass that extends editText, I'm not intrested in implementing the functionality I want to add on keyboard hidden in all my app, I want to add it for just one Activity, I tried <code>onKeyDown</code>, <code>onKeyBack</code>, <code>onKeyUp</code>, <code>onBackPressed</code> nothing seems to log the back press that closes the soft keyboard.</p>
  <p>so my question is there a way to detect the click on the button that hides the keybaord?</p>