Activity.finish() called but activity stays loaded in memory

You don’t control when your app leaves main memory, the OS does. Look closely at Activity.finish

Call this when your activity is done
and should be closed. The
ActivityResult is propagated back to
whoever launched you via
onActivityResult().

Note that is says nothing about memory. As to calling Activity.onResume, that’s exactly what you would expect for the lifecycle; remeber that onResume is not just called after a resume but even when the app is first launched after onCreate.

While not exactly what you asked I suggest you read this article about exit buttons which goes on to say something very important

[Activity.finish] is exactly equivalent to hitting the back button.

Leave a Comment