I have two activity in my app, A and B. They run in different task. which means A is the startup activity, B has singleTask launchMode and a different taskAffinity.
When I start B from A (A->B), a new task will be created. Here comes my question, when I press home button to push app to background and click the app launch icon to bring to foreground again, what I see is activity A. What should I do to see B when app go to foreground?
EDIT: It ain't pretty but it works. The singletask launchmode blocks the normal way that you get your current activity, so here's a workaround. The only disadvantage is that you would call startActvity again, possibly being visible.
Add this to your AndroidManifest.xml
Add this class to your package
In the onCreate of B, post this line:
Add this method to A:
Something I forgot to add, you should add this method to B: