title: Catch android's back button press event when showint a dialog/spinner's list?
body: <p>I need to capture the event when my app is showing a dialog and i press the device's back button.</p>
  
  <p>Well it is not definetly a dialog. It is a dropdown list for my spinner.</p>
  
  <p>I tryed:</p>
  
  <pre><code>public boolean onKeyDown(int keyCode, KeyEvent event) 
  {
      if (keyCode == KeyEvent.KEYCODE_BACK)
      {
  
      Toast myToast = Toast.makeText(getApplicationContext(), "back putton pressed", 1);
      myToast.show();
  
      }
  
      // Call super code so we dont limit default interaction
      super.onKeyDown(keyCode, event);
  
      return true;
  }
  </code></pre>
  
  <p>Not worked.</p>
  
  <p>I also tryed:</p>
  
  <pre><code>public void onBackPressed()
  {
  
  
      Toast myToast = Toast.makeText(getApplicationContext(), "back putton pressed", 1);
      myToast.show();
  
  }
  </code></pre>
  
  <p>I even tryed this with overriding.
  So none of the above sollutions are worked for me. I found both of these on stackoverflow but for some reason they are not working for me.
  Of course they work when there is now dialog showing, but when do... they are not run.</p>
  
  <p>Any ideas ?</p>
  
  <p>So my </p>