Possible Duplicate:
is there a default back key(on device) listener in android?
How can I respond to the physical back button in my Android application? Like a listener of a sort.
I want to do things when that button is pressed!
If I understand your question, simply override onBackPressed()
in your Activity for API 5+.
@Override
public void onBackPressed() {
super.onBackPressed();
// Do something
}