How to listener homebutton in android
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/5907102/home-button-listener">Home button listener</a>  </p>
</blockquote>



<p>I use below code to listener home button pressed:</p>

<pre><code>@Override
public boolean onKeyDown(int keyCode, KeyEvent event)  {
    System.out.println(keyCode);
    if(keyCode == KeyEvent.KEYCODE_HOME) {
        //do things
        return true;
    }
    return super.onKeyDown(keyCode, event);
}
</code></pre>

<p>Why it no response?
I try to show the keyCode.
While I press other button, it show keycode.
Only press home button, it does show.
How can I modify it?</p>
