user3473590
user3473590

Reputation:

How to change task affinity in Android?

There is an activity (A) in my application that can be called from other apps (B)

if A is called from B, in recent task there are an instance of B and an instance of A. i want that A be showen as part of B Task.

I've found that by adding same taskAffinity to both activities manifest file it works as i want. but i can't access B.

android:taskAffinity="xxx.yyy"

so, how do i find affinity of task B and change affinity of task A to it? OR is there a better way?

Upvotes: 2

Views: 3691

Answers (1)

apricot
apricot

Reputation: 3767

Since FLAG_ACTIVITY_NEW_TASK is required for taskAffinity to take effect (that is, place activity A in a different task), start Activity A without using FLAG_ACTIVITY_NEW_TASK. I think this will cause activity A to be in the same task as activity B. This requires a change to B.

Upvotes: 0

Related Questions