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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
New Developer
Posts: 7
Registered: ‎08-27-2008
My Device: Not Specified

Dialog with multiple options and Back button event.

i am using switch case to handle multiple options functionality those are specified in the Dialog box.
but the problem is, when the Dialog is displyed and if i click on back arrow button of device its not taking me to previous screen.I tried with onClose() event but its not working.
Any idea how to handle this event?
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Dialog with multiple options and Back button event.

Which is the Back button?  What device are trying this on and which must it work on?

 

Have you thought about a KeyListener?

New Developer
Posts: 7
Registered: ‎08-27-2008
My Device: Not Specified

Re: Dialog with multiple options and Back button event.

Default blackberry back button.On 8820.

But back button is working for screens not for Dialogg.

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

Re: Dialog with multiple options and Back button event.

Dialog extends Screen, which has a keyChar() method.  I would try to override this, check for key == Characters.ESCAPE, and process accordingly.  Possibly you can just call close().  However I've never tried it myself.  Give it a go and tell us what you find.

 

I normally refer to that key as the Escape key, which is why I was confused by you calling it the Back key.

New Developer
Posts: 3
Registered: ‎01-28-2009
My Device: Not Specified

Re: Dialog with multiple options and Back button event.

When you create the Dialog, specify a values array that includes Dialog.CANCEL:

 

 

String choices[] = { "Yup", "Nope" };

int values[] = { 1, 2, Dialog.CANCEL };

Dialog d = new Dialog("Agree?", choices, values, 1, null);

 

When values contains CANCEL, the ESCAPE key is handled automatically.