Android Question [Solved] Detach app from the one invoked it through intent

klarsys

Active Member
Licensed User
Longtime User
I have an app that can be invoked by clicking on a link. I implemented it using intent filter with VIEW action.

This is how it works:
1. I receive a link in (let's say) WhatsApp. Link is of the form: http://xyz/abcd
2. I tap on the link and Android asks me to open with browser or my app.
3. I select my app.
4. My app starts and is active.

Now, the issue:
5. I press HOME button.
6. I click on WhatsApp launcher icon.
7. I see my app coming up, instead of WhatsApp.

I do not see such behavior if I select browser in step 3.

How do I detach my app from WhatsApp (in this example) once my app starts through intent filter?
 

klarsys

Active Member
Licensed User
Longtime User
I have two activities, the Main activity receives MAIN (launcher) as well as VIEW (intent) actions and after showing a splash screen, starts the UI activity and does Activity.Finish for itself.

Another option is to call Activity.Finish when it is paused
Isn't above sufficient?
Should I also do Activity.Finish in Activity_Pause?
Does the seqence Start UI activity, then Activity.Finish matter?

If I need to change launch mode of UI activity, are there any Activity Attributes or should I use Manifest Editor or do I manually change it?
 
Upvote 0
Top