Android – Simulate Back Button

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, Fragments didn’t exist, and (as several commenters have pointed out) this doesn’t work quite the same way when there are Fragments involved. There are better approaches now if you’re using Fragments.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)