Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Contributor
Posts: 49
Registered: ‎05-02-2012
My Device: Bold 9790
My Carrier: Wind Mobile

Custom dialog cancel

[ Edited ]

Hi there,

 

I made a custom dialog box that has several choices like this:

 

String[] options = {"Home Page", "Feature Requests", "Bug Reports"};
int choice = Dialog.ask("Going to www.wcischeduleapp.com", options, 0);

 

I was wondering how to tell if the dialog was exited with the back button, in which case I wouldn't want to pick any of the options. Right now it always picks the "Home Page" option.

 

Thanks,

Ben

Contributor
Posts: 49
Registered: ‎05-02-2012
My Device: Bold 9790
My Carrier: Wind Mobile

Re: Custom dialog cancel

Highlighted
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Custom dialog cancel

Just to extend what you have found:

 

if ( choice == Dialog.CANCEL ) {

// will also pick up 'escape'

}