I want to disable the back-button in my application. But ONLY when this method is active:
public void winCross() {
final Dialog dialog = new Dialog(this, android.R.style.Theme_Translucent_NoTitleBar_Fullscreen);
dialog.setContentView(R.layout.winnercross);
dialog.show();
How can I do this?
Use
dialog.setCancelable(false);This will make the back button have no effect on the dialog, rather than disabling the back button for only that method (which is fiddly).