开发者

How to add a another button on a Dialog of Blackberry [duplicate]

This question already has an answer here: 开发者_高级运维 Closed 11 years ago.

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


  1. Extend your CustomDiaolog from Dialog class
  2. Create the button object that you want to create
  3. Add required listeners or navigationClick or keyChar event
  4. Add them to the CustomDiaolog that's all.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜