Search code examples
androidandroid-intentactivity-lifecycle

Is Intent bundle persisted when activity is destroyed by OS


When an activity is started with intent extras, does the data survive after orientation change and destruction by OS, or do we need to take care of it in onSaveInstanceState?


Solution

  • The arguments passed as extras on the Intent are preserved across configuration changes (such as orientation change), as well as when the activity is being destroyed to free up memory. There is no need to store these arguments in onSaveInstanceState.