In my application I have three activities A, B and C. Activity A is starting activity B with a specific requestCode (and waiting for a returned result) and activity B is starting activity C. In the manifest, C is set to not store it’s history on the stack, so when users continue, they are sent to activity B. Now at this point the back stack looks like ABB from bottom to top. The bottom most B was started with the correct requestCode but the top most B was not started with any requestCode. Now my question is, how can I make it so that the bottom most B is “resumed” rather than that top most B being created? Also, I’ve tried to use the “singleTask” and “singleTop” attributes for the B activity in my manifest and while it did use the same instance of the activity already on the stack, it seems the requestCode was no longer the same as if activity A had started.
Share
actually I was reading about the different flags used to start activities and found the
FLAG_ACTIVITY_REORDER_TO_FRONTflag. This accomplishes exactly what I wanted, it resumes an activity already on the stack without creating another instance, and doesn’t issue or change any existing requestCodes.