android 4.0 Dialog gets canceled when touched outside of dialog window

Check this method from the Android Developers site for dialog. Try using the dialog.setCanceledOnTouchOutside (boolean cancel) Pass a boolean value to enable/disable dialog behaviour when touched outside of the dialog window. Also go through these links: How do I fire an event when click occurs outside a dialog How to cancel an Dialog themed like … Read more

How to create and show common dialog (Error, Warning, Confirmation) in JavaFX 2.0?

Recently released JDK 1.8.0_40 added support for JavaFX dialogs, alerts, etc. For example, to show a confirmation dialog, one would use the Alert class: Alert alert = new Alert(AlertType.CONFIRMATION, “Delete ” + selection + ” ?”, ButtonType.YES, ButtonType.NO, ButtonType.CANCEL); alert.showAndWait(); if (alert.getResult() == ButtonType.YES) { //do stuff } Here’s a list of added classes in … Read more