Reputation: 13
I am quite new to Android so please be patient.
When you start a new activity, by default, the Back button on the device should take you back to the previous activity.
In my case I have to press the back button twice before it goes back to the previous activity.
Please advise
Upvotes: 0
Views: 965
Reputation: 93842
private int count = 0;
@Override
public void onBackPressed() {
count++;
if (count == 2) {
//Do your stuff here
count = 0;
}
}
Upvotes: 3