When i press a button in my app, I need to return to the last activity.
Any ideas?
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.
Calling
finish()from the activity you want to end should take care of this.Edit many years later: This still works, but it’s a bit of a heavy-handed approach. When I originally posted this,
Fragmentsdidn’t exist, and (as several commenters have pointed out) this doesn’t work quite the same way when there areFragmentsinvolved. There are better approaches now if you’re usingFragments.