Skip to content

Instantly share code, notes, and snippets.

@Mercandj
Last active July 17, 2020 10:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mercandj/1a43ffba068c05e6ee3f614d6d89d31c to your computer and use it in GitHub Desktop.
Save Mercandj/1a43ffba068c05e6ee3f614d6d89d31c to your computer and use it in GitHub Desktop.

Android: Activity restoration

When you user click Home on any of your activity, the system will save the state of the activity stack and the state of your top-activity.

Then, when your user go back to your application, this activity and the activities stack will be restored on a new JVM.

How to test it?

  • Open your app
  • Go to the activity you want to test
  • Click Home and wait 3s
  • Run this command adb shell am kill <app-package-name>
  • Launch the app from "Recent activities"

Sources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment