@Override public void onBackPressed() { // code here to show dialog super.onBackPressed(); // optional depending on your needs ... }