Reputation: 45931
I'm developing an Android 2.2 application.
I want to know which activity method is ran when user press back key.
I have found this: "When the user presses the BACK key, the current activity is popped from the stack, and the previous one resumes as the running activity. "
But it doesn't tell what method is ran.
Thanks.
Upvotes: 0
Views: 858
Reputation: 1007265
In Android 2.2, pressing the BACK button triggers onBackPressed()
in your activity. The default implementation of onBackPressed()
calls finish()
.
Upvotes: 2