Reputation: 527
I want to use the startActivityForResult()
method from the onCreate()
method of another activity. My problem is that the onCreate()
does not wait for the result of the new activity (that I called to using startActivityForResult()
) and therefore the application stops.
Is there a way to tell onCreate()
to stop until the new activity sends the result?
Upvotes: 0
Views: 85
Reputation: 3658
An option i've seen to go to a login activity when the user's not yet logged in is the following:
Upvotes: 1
Reputation: 95578
In general, you can use startActivityForResult()
in onCreate()
to launch the login activity, but you can't wait for the results. You'll need to move all the code that onCreate()
would normally do in onActivityResult()
as that will be called when the login activity completes.
Upvotes: 3