I have two application, App A and App B, now I want to start an activity in App B from App A, the launchmode of this Activity is “singleTask”.
The order: Activity X (App A) ———> Activity Y (App B) ———> Activity Z (App B, launchMode=“singleTask”)
As default AndroidManifest config, there will be two App shown in the Task Manager, I hope users can only see App A label in Task Manager, so when they switch between tasks they don’t click App B. Before Android 11(Android R), I use the attribute taskAffinity as below to solve this problem.
Both Activity X and Activity Z, add this in AndroidManifet.xml
android:taskAffinity="com.abc.xxx”
So these activity can both house in one activity task. In Android 10, it works.
However, it doen’t work in Android11 anymore. And, I didn’t find any new features relevant to this scene.
How can I make ApplicationA’s activity task house the activity of ApplicationB which launchmode is singleTask? Let users see only one task(ApplicationA) in task manager.