What are the scenarios in which I should call finish() method on back button or it is good to call it on each back button..??
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.
it depend on your app requirement, for example:
case 1: when press back, need over your activity, so you need invoke
finish, this is defaultcase 2: in one activity, has 3 step, like a->b->c, if you in the step b or c, you press back just want to back previous step, to b or to a, so you dont need invoke
finishmethod inonBackPressedso, above just a example, you need make a better choice in your situation.