on back press in settings code example Example: onbackpressed @Override public void onBackPressed() { super.onBackPressed(); }