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
Developer
Posts: 235
Registered: ‎11-12-2008
My Device: Not Specified

Dialog error in runtime...

Dialog dSure = new Dialog(Dialog.D_OK_CANCEL, "Are you sure you want to delete this record?", Dialog.D_OK, null, 0);
            dSure.doModal();-----------here the exception is
            int response = dSure.getSelectedValue();
           
            if(response == Dialog.D_OK) {

         
         }

Giving runtime exception........in O.S 5.0.0(i.e 9700 simulator)

 

 

can ant one has the solution of this...

Highlighted
New Developer
Posts: 15
Registered: ‎07-20-2009
My Device: Not Specified

Re: Dialog error in runtime...

Hi,

 

where you are calling this dialog.

If you are calling it in a separate thread you have to get event lock first.

 

try this:

 

UiApplication.getUiApplication().invokeLater(new Runnable()
{
    public void run() {
       Dialog.alert(e.toString());
    }
});