How do I display a dialog to the user asking him if he wants to continue, with a choice of yes or no?
Asked
Active
Viewed 1,784 times
4 Answers
0
Dialog d = new Dialog("Do you want to continue?", new String[]{"Yes","No"}, new int[]{Dialog.OK,Dialog.CANCEL}, Dialog.OK, Bitmap.getPredefinedBitmap(Bitmap.QUESTION)){
public void setChangeListener(FieldChangeListener listener) {
if(d.getSelectedValue() == Dialog.OK){
//true part
}
else{
//false part
}
};
};
d.show();

vajapravin
- 1,363
- 3
- 16
- 29
0
Came here late but maybe helpful to someone in future:
int ans = Dialog.ask(Dialog.D_YES_NO, "Do you want to continue?", Dialog.YES);
if (ans == Dialog.YES)
// Continue
else
// Do not Continue
The third parameter states the default selected option which is set to the Yes
option.
Here's an article on how to work with different types of Blackberry dialogs.

ThePCWizard
- 3,338
- 2
- 21
- 32
0
You need to use one of the Dialog
s provided by BB like Dialog.ask(someNumber,"Your message");

tipycalFlow
- 7,594
- 4
- 34
- 45