I know there are much discussions about this but i cannot get this to work properly.
Activity (A) = singleTop and can receive android.intent.action.SEND
Activity (B) = singleTask
When i from the Android Gallery select a picture and open it with (A)
The (A) is redirecting the intent to (B).
This is working ok and if i press HOME and select (A) from the luncher
the (B) is brought to front. That is what i want and user can continue with picture,
Now, if i press HOME and open the Android Gallery again the (A) is
onRestart(), OnStart() and onResume(). and i see (A).
This is the problem i like to switch to (B) because user need to finish what he was doing.
I cannot see a good way to do that and why does the Android Gallery resume (A)?
Maybe i do something wrong since opening the Android Gallery bring me (A)
Any help would be appreciated
UPDATE
I know this is an intricate scenario. I have made a working solution by simply killing (A)/finish() after the launch of (B). Now,
if i press HOME and open the Android Gallery again i see Android Gallery.
if i press HOME and open A i see B.
if i press back from B I see the gallery