I'm still having a lot of trouble understanding the problem but would like to help you fix it. Since comments only allow 600 characters and don't format well, I'm going to create an answer instead, because I'm sure that together we can get this resolved.
I would like to be able to reproduce your problem. To do that I've created 2 applications: AppA and AppB. AppA has a single activity called ActivityA
and AppB has a single activity called ActivityB
. Both ActivityA
and ActivityB
use android:launchMode="singleTask"
.
ActivityA
has a button on it that launches AppB and finishes, like this:
Intent intent = new Intent("de.sharpmind.example.AppB");
intent.putExtra("extra", "launched from AppA");
startActivity(intent);
finish();
ActivityB
has a button on it that launches AppA like this:
Intent intent = new Intent("de.sharpmind.example.AppA");
intent.putExtra("extra", "launched from AppB");
startActivity(intent);
This all works as I expect it to. AppA and AppB run in different tasks. The "extra" is properly seen in the onCreate()
methods of each application.
So, can you please tell me more about your problem. How can I reproduce exactly your problem? You wrote:
On lower APIs the new task in APP-A will not change and extras putExtra will have no effect.
What do you mean by that? Where are you putting extras and where are you getting them and what do you expect to happen?
Also, what is the launchMode
of your AppB
?
Also, when you have this problem, are there other activities in the task stack for AppA?
Please provide more info, either in your original question or here as comments.