Is there a method of the Activity lifecycle which is called if the user presses the back button, but not if the the method startActivityForResult() is called? I couldn’t find a method by testing it.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m sorry, I just didn’t saw the solution, but here it is:
By calling startActivityForResult(), the methods onPause() and onStop() of the original activity are called.
When pressing the Back Button, the methods onPause(), onStop() and onDestroy() are called.
So the difference is the onDestroy() method.