Skip to content

Instantly share code, notes, and snippets.

@mcatta
Created May 12, 2013 16:05
Show Gist options
  • Save mcatta/5564025 to your computer and use it in GitHub Desktop.
Save mcatta/5564025 to your computer and use it in GitHub Desktop.
Override backPress android
@Override
public void onBackPressed() {
if(close_count==1) {
Toast.makeText(getApplicationContext(), "Press back again to close application...", Toast.LENGTH_SHORT).show();
close_count--;
return;
}
super.onBackPressed();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment