Understanding of isFinishing()

Your Activity doesn’t get killed by the OS while it’s in the foreground. That wouldn’t make sense.

However, if the activity goes to the background because the user switched to a different app, it could get killed after onPause() has been processed. As such, you could get isFinishing() == false as the user switches to a new app, but then the app is killed.

As the doc says, save all persistent data in onPause(). onDestroy() is not guaranteed to be called.

(I wouldn’t be surprised if Dianne steps in and corrects me here, btw.)

Leave a Comment