Reputation: 239
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");
Upvotes: 4
Views: 690
Reputation: 7483
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.
Upvotes: 3