0

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?

KT_
  • 978
  • 11
  • 26
  • You should not need `singleTask` or `singleInstance` launch mode for this. Please try without and explain what happens (if it does not work). – David Wasser Aug 25 '17 at 08:54
  • Thanks. But I was getting a looping behavior without it: i.e., it would just keep relaunching Google auth instead of realizing it's been authorized. I've handled the situation by moving the authorization call into a separate sub-activity and making that one singleTask. If that's not (supposed to be) necessary, it's likely something else I'm doing in the larger structure of things. – KT_ Aug 28 '17 at 13:47

0 Answers0