user1209216
user1209216

Reputation: 7974

Android - Intent for App Shorcuts

When saying "app shortcuts", I mean this: https://developer.android.com/guide/topics/ui/shortcuts.html

My app has following flow:

Then my LoginActivity is launched. LoginActvity handles user login via Firebase - user is able to choose login with Google, Facebook or email. After succesful login to Firebase, my app calls rest webservice to get access tokens from my server, then it starts MainActivity and passess access tokens to it. There is also FirebaseAuth.AuthStateListener used to handle auto login on app launch (until user logs out), without asking for any credentials. MainActivity has some flow too, it performs some operations, then it allows to choose what do display, from navigation drawer menu. There are some actions required to do by users, it depends if app is launched first time (force to select city from list, cities list loaded from backend).

Now I need to develop static app shourtcuts with intents for:

I'm stuck, because I have no idea how to implement intent to preserve all required steps. I can't just declare intent to launch MainActivity, it won't work because this will cause to launch MainActivity immediately, without any required initialization, get access tokens etc.

Any tips?

Upvotes: 1

Views: 52

Answers (1)

user1209216
user1209216

Reputation: 7974

Ok, so I managed it by set action for each intent, then populate action name to decide, which option should be launched. I think it's simplest solution

Upvotes: 0

Related Questions