Related to: Android Messaging, Email app behavior when starting app from a link
To be able to start my app from an SMS, and then upon hitting the Messaging icon, have Messaging go back to where it was before (at the message showing the link), I added this to the manifest:
<activity android:name=".SMSActivity" android:launchMode="singleTask" >
But now when I do this, my app starts up great the first time I click the link in the SMS. If I then go back to Messaging and click the same link, my app is started, but with a completely black screen.
It seems I can't have it both ways. Changing the launchMode to singleTop fixes this problem, but if I do that, then if I launch the app from the SMS, my app takes over the Messaging app. The Recent list shows only the Messaging app running my app. I can't go back to Messaging.
There must be a way to get this to work. I have tried many combinations of launch modes in the manifest, and intent flags when starting up SMSActivity. Currently I am just using default flags when starting SMSActivity. I am not adding any flags to the Intent.
Thanks