4

This is my code to create the default dialog in Codename one. When the user clicks ok it must proceed/call a function and when they cancel the dialog should just close.

Dialog.show("Confirm", "Do you want to proceed?", "OK", "Cancel");
Yung A
  • 239
  • 1
  • 2
  • 12

1 Answers1

3

The solution is pretty simple:

if (Dialog.show("Confirm", "Do you want to proceed?", "OK", "Cancel")) {
    //Ok action goes here
}

If you want to handle cancel, just add the else part.

Diamond
  • 7,428
  • 22
  • 37