I want to end the whole application when user click back button in android
<p>I want to end the whole application when user click back button in android.Currently It again go to previous opened activity.
I also try override onBackPressed() but it doesnt work.</p>

<pre><code>public boolean onKeyDown(int keyCode, KeyEvent event) {
    if (keyCode == KeyEvent.KEYCODE_BACK) {
        onBackPressed();
    }
       return super.onKeyDown(keyCode, event);
}
enter code here
@Override
public void onBackPressed() {
    // TODO Auto-generated method stub
    super.onBackPressed();
    return;
}
</code></pre>
