how to override action bar back button in android?
<p>here is my query
I want to customize the activity back button in action bar not in hard key back button?
I have override the onBackPressed() method it works with my emulator back button and not </p>

<p>with action bar back button. </p>

<p>I want it to happen with action bar? How can I do this?
Here is my code</p>

<pre><code>@Override
public void onBackPressed()
{

    Toast.makeText(getApplicationContext(),"Back button clicked", Toast.LENGTH_SHORT).show(); 
    return;
}
</code></pre>

<p>I have used this toast whether back pressed is working or not but the actual implementation changes like to move back to previous activity. but this is not working with the button present on Top of Action bar (Besides Title of the activity).</p>

<p>Please any one could specify me the problem.</p>
