I have a SearchAcvitity which has a child PersonActivity. Each are FragmentActivity\'s. Here\'s my manifest file:
I think someone may have asked the question before: onCreate being called on Activity A in up navigation
Basically it is expected behavior. You need to save state into the bundle, which you can restore in onCreate.
UP navigation launches the parent Activity with Intent.FLAG_ACTIVITY_CLEAR_TOP
. The standard behaviour of this flag is to finish all Activities that are on top of the parent Activity in the task stack including the parent Activity itself and then launch a new instance of the parent Activity**. If you want to resume the existing instance of the parent Activity, then you can set the following in the manifest for the parent Activity:
android:launchMode="singleTop"
When CLEAR_TOP and SINGLE_TOP are used together, this will resume an existing instance of the parent Activity. In this case, onCreate()
will not be called on the resumed parent Activity, but instead onNewIntent()
will be called instead.