I have three activities A, B, and C. As expected when C is changed to pip (picture in picture) mode, it is separated out as a new task. When back pressed is pressed on Activity C, it will be finished and the user will be sent to the android system home screen. I want the user to shift to the activity from where Activity C was called; including the whole back stack of that task.
The experience can be understood like this:
Task1: A->B->C
user presses home button, c is now shifted to pip mode
Task 1: A->B
Task 2: C
Now C is sent to full screen and back button is pressed.
Task 1: A->B
Task 2:
The user has been sent to the android home screen. I want the user to be shifted to Activity B. Basically, it means, I want to get access to the previous running task (Task1) after the current activity in another task (Task2) is over.
In your manifest, add ActivityB as Parent activity to C
AndroidManifest.xml