Let’s imagine the ActivityB invoked from ActivityA with extras in it. When ActivityB starts we check in onCreate() method the bundle holds these extras we put in ActivityA. I’ve noticed that ActivityB still holds extras after orientation change, i.e. after ActivityB has been just recreated, but not called by ActivityA which puts extras in Intent. Meaning extras are always “alive”? If I understand this right, where/how Activity keeps it?
Let’s imagine the ActivityB invoked from ActivityA with extras in it. When ActivityB starts
Share
I believe you will find that if onDestroy() is called on your Activity, then the intent will be “reset” and will have no extras, which is what you expect to happen with a rotation change.
To actually remove an extra from an Intent, you need to call removeExtra(String extra) on the Intent.
If you do not call removeExtra, then yes, the extra will stay in the Intent until the Activity is destroyed.