Reputation: 33
I am showing a message on a button click ("plz verify Email."). And when the user click on the button then browser will be open and I want to redirect my app into first activity in background.
I want my app to return to his first state when the user come back on it.
Upvotes: 3
Views: 112
Reputation: 8477
When the user clicks the button to close the dialog, then from the calling activity create an Intent and start the Browser with startActivityForResult()
.
In the same activity, implement onActivityResult()
. In there, create an Intent and start your initial activity with startActivity()
.
For more information, refer to the Android docs on Activities and Intents.
Upvotes: 1
Reputation: 23596
Just call finish(); whenever you want to finish the Activity.
Upvotes: 0
Reputation: 13101
you can set a flag when you start the intent, and test it in onResume
when it was true, finish it self and start the first acrivity. Buy the way, set the launchMode of the first activity to singleTop
Upvotes: 0