I am really confused. I have read that the back button
I think onPause() should be right. But this is an side effect, because the Activity gets into the background. I found nothing in the docs. But maybe I have overlooked something.
Can someone please explain to me what the back button is supposed to do programmatically? Some references would also be nice. 🙂
All three are correct.
Quoting the Android documentation:
To elaborate, if there is nothing else that will consume the BACK button press (e.g., an open options menu), your
Activitywill be called withonBackPressed(). The default implementation of this callsfinish(). This will take your activity from the running to the destroyed states, callingonPause(),onStop(), andonDestroy()in sequence, as shown in the event flow diagram: