How to add a another button on a Dialog of Blackberry [duplicate]
Possible Duplicate:
How to create a custom dialog
I am making a dialog . I want to creat two button is (" View " ) and " Cancel " button. How do I creat " View " button on Dialog ?
Instead of creating a custom dialog, you can use the dialog.ask like the code below:
int i = Dialog.ask(""Your text", new String[] {"View", "Cancel"}, new int[] {1, 2}, 1);
if (i == 1)
//your code for view button
else if (i == 2)
//your code for cancel button
- Extend your CustomDiaolog from Dialog class
- Create the button object that you want to create
- Add required listeners or navigationClick or keyChar event
- Add them to the CustomDiaolog that's all.
精彩评论