• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps physical back button code

Use the onBackPressed() method of Activity. From the manual:
Called when the activity has detected the user's press of the back key. The default implementation simply finishes the current activity, but you can override this to do whatever you want.
 
Back
Top Bottom