I have a photo editing app that is registered to a share intent (ACTION_SEND
). I am struggling with a strange behaviour it has in the following scenario:
- I launch my app from the home screen and open a photo to edit
- I press the home button and launch a gallery
- I open a photo in the gallery, press Share, and choose my app
- A different instance is opened. In the task overview, I see my standalone app task and the gallery task
- From the instance initiated by the Share intent I start a new activity (by startActivity)
- When I press back on the new activity, I return to my standalone app! Only if I keep pressing back, I get to my Share-launched instance, by keep "backing" I get back to the gallery.
In short, it seems as if the instance of my app that started from the icon is being annexed to the task of the gallery once it issued the ACTION_SEND
intent.
I have no special setting in the Manifest regarding task management. The same behaviour happens with different galleries (including Google Photos) so I guess they fire a standard intent with no special flags.
I tried setting taskAffinity=""
but that caused other activities
in my app to have distinct tasks in the overview..
It's all very frustrating.. Will appreciate any hint..