I am running into an issue where my CloudRail-using Activity
requires Google's OAuth authorization, so it must do it through the Chrome browser and get back the authorization via a custom scheme.
In order to get it handled in the same (calling) Activity
, I must use android:launchMode="singleTask"
(or, I guess, maybe singleInstance would work as well).
The issue comes when my main activity launches one of the app's other activities. If I happen to switch away from the app, then tap the app icon on the desktop again, it relaunches the main activity. This only happens when I've specified the launchMode
as above.
Things behave as expected — i.e., "relaunching" the app from the desktop when previously in a different sub-Activity
will resume that sub-Activity
— if I remove the launchMode
specifier.
Any suggestions on what to do in order to get both behaviors? i.e., to handle the custom scheme callback from Chrome as well as be able to resume back to whatever Activity
is currently/was last active?