Let's say we have a default, empty activity with default behaviour, launched with default intent flags. User presses back button on the device. The activity disappear... but how, actually?
- Is pressing back button behaving the same way like
finish()
? - Is the activity immedietely destroyed (
onDestroy
is called)? - Is the activity guaranteed to be destroyed, but not immedietely?
- Is there any chance the activity won't be destroyed and this instance will be reused when this activity is launched in the future? (so only
onPause
andonStop
->onStart
andonResume
are called?)
I'm looking for a reliable answer, so please do not answer if you are not absolutely sure what happens here.
default, empty activity with default behaviour, launched with default intent flags
you can't reproduce? Just create a default project in your IDE. – Holmquist[...]your activity is destroyed due to normal app behavior, such as when the user presses the Back button or your activity signals its own destruction by calling finish().[...]
I would recommend to read the whole chapter though. – Lovett