I’ve an app with 3 activities
LoginActivity
ActivityA
ActivityB
User starts with LoginActivity. After successful login, he goes to ActivityA. ActivityA invokes ActivityB using startActivityForResult and processes the response using onActivityResult.
If user presses ‘Home’ button from ActivityA or ActivityB and relaunches the application, I want to take user back to LoginActivity
I tried playing around with onRestart and onResume. Both of these are called when ActivityA is reinitialized via home screen or onActivityResult (when user comes back from ActivityB).
How can I implement this requirement?
PS: I checked similar questions on SO and did not find something that matches my requirement.
Thanks.
I will redirect you to this question here. I think it should answer your question.