I have Four Activity - A,B,C,D
I am calling these four activity in manner --> A-B-C-D-B. (Specified Manner)
I have three scenario.
1st :- I am defining android:launchMode="singleTask"
only in B Activity. And I am calling all activity via Intent
in above specified manner.
Now First calling A-B-C-D , BackStack Task 1 : A-B-C-D,
Now I again call B, Then BackStack Task 1 : A-B
. Here C and D Activities are destroyed.
2nd :- I am defining android:launchMode="singleTask"
& android:taskAffinity=""
in B Activity. And I am calling all activity via Intent
in above specified manner.
Now First calling A-B-C-D , BackStack Task 1 : A
Task 2 : B-C-D
Now I again call B, Then BackStack Task 1 : A
Task 2 : B ,Here C and D Activities are destroyed.
3rd :- I am defining Intent.FLAG_ACTIVITY_NEW_TASK
& android:taskAffinity=""
in B Activity. And I am calling all activity via Intent
in above specified manner.
Now First calling A-B-C-D , BackStack Task 1 : A
Task 2 : B-C-D
Now I again call B, Then BackStack Task 1 : A
Task 2 : B-C-D , Here **Can't call B again**
And here It says FLAG_ACTIVITY_NEW_TASK produces the same behavior as the "singleTask" - https://developer.android.com/guide/components/activities/tasks-and-back-stack.html
So Which are correct scenarios? I am getting it right or I am misunderstanding something.
onNewIntent()
in the activities withsingleTask
launchMode ? – TypewritingA
launchB
and thenB
launchesC
and thenC
launchesD
and thenD
launchesB
? – MastodononNewIntent()
is totally irrelevant to this question. – Mastodon