Reputation: 583
I was not sure how to search for this thing, so ended up posting the question.
I have an app, that requires Authentication for using it. I added a Share Intent to it, so that other apps could be able to Share using my app.
The main activity is StarterActivity that calls LoginActivity. But, my share activity is ShareActivity which is called when people use share via my app.
My question is, currently when I select "Share" it directly takes me to the Share Activity, without authentication.
How do I make the behavior such that when a user selects my app from "Share" it first asks them to Login and on successful login, take them to Share Activity, along with the data that they passed while using the Share Intent.
I hope the question was understandable.
Please help.
Regards.
Upvotes: 0
Views: 137
Reputation: 3236
Logically, you might want to start your application this way, every time the application launch, it goes to StarterActivity, this will check whether you're logged in or not, if yes, it starts ShareActivity, if not, it starts LoginActivity.
In this case, when user selects "share", you still launch StarterActivity, passing in share details with an extra using Intent.putExtra() function, which you will be passing from Starter to Login, lastly to Share, is this what you would prefer?
Upvotes: 1