My application has 2 launch activities A and B. Activity B has taskAffinity="Task2".
1) Launch B from android menu, change some fields there, then press home button.
2) Launch activity A. From A, launch B with flag FLAG_ACTIVITY_NEW_TASK. This fields are not saved. Thats the problem.
Now there is this:
- MainTask: Task2:B(first)
- MainTask:A Task2:B(first)
- MainTask:A Task2:B(first) -> B(second)(OnTop)
But I want this:
- MainTask: Task2:B(first)
- MainTask:A Task2:B(first)
- MainTask:A Task2:B(first)
Help me please. I want to apologise in advance, this is my first post and my english is not good.
I found answer. In manifest file need to write android:launchMode="singleTop" for activity B.
You can set
or
or
depending on your actual need. All of the three will achieve what you want.