0

I am working on the capability of starting an app via an SMS link or an email. It is all working fine. Custom links don't parse on Android phones, but that is another story. My http style link works great. But the issue is the behavior of apps like Messaging, Android GMail App, Android Mail app, Android Outlook app, Whatsapp, etc. ( Here is the scenario:

  1. Go to app, like Messaging, Gmail, etc.
  2. Click on the link to start up my app (app starts up correctly)
  3. Hit the Home Button
  4. Hit the icon of the app that I used to start up my own app

On Samsung phones, when I do step 4 (above), the Messaging and Outlook apps show my app, not the message or email list. The Gmail and Android Email apps behave correctly (in my opinion). These apps bring you back to where you were in that app. On my LG phone, the Messaging app behaves correctly. Whatsapp always seems to behave badly.

My main concern are messaging apps, as I want to use SMS as a way to start up my app. I think that the Messaging app should go back to the message list like my LG phone.

Is there a solution to this? Thanks

fbs419
  • 51
  • 5
  • This has something to do with the ActivityFlags. Currently, I am just starting the activity with no activity flags added. Not sure what behavior that gives. I noticed that in the apps that behave poorly, for example Messaging, when I hit the recent apps button, Messaging is not there -- only my app. For the Gmail app, recent apps show both. Adding the NewTask flag changes that behavior, but it still doesn't work right. The Messaging app shows up, but it's just a blank black screen. Adding ClearTop doesn't help. There are a host of other activity flags -- need to see what they each do. – fbs419 Jun 28 '18 at 21:24
  • Well now I'm starting to think that the NewTask flag is a mistake. It breaks the apps that work well -- with it, if I go to Recents, there is a new task of my app that is black. The main issue is that 2 built in apps -- Gmail and Messaging behave differently. That seems strange at best. – fbs419 Jun 28 '18 at 22:38

1 Answers1

0

So the answer in this case is to add android:launchMode="singleTask" to the activity attribute in the manifest. Then all Messaging, Outlook, Mail, and Gmail apps all behave correctly.

Now have to figure out how to prevent the user from trying to open this app multiple times.

fbs419
  • 51
  • 5