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: 45
Registered: ‎06-05-2009
My Device: Not Specified

Dialog box prompt.

UiApplication.getUiApplication().invokeLater( new Runnable() { public void run() {

 

 Dialog dia_answer = new Dialog(Dialog.D_YES_NO,"Are you sure you want to upload a new version of "+filename+" ?",Dialog.YES, Bitmap.getPredefinedBitmap(Bitmap.INFORMATION),Dialog.GLOBAL_STATUS);

}

});

 

I have another dialog  box  :-

Dialog statusDlg =  new Dialog("Uploading File...",null,null,0,icon);

which is a modeless dialog box which comes after the user says YES to the dia_answer box.

statusDlg is being invoked using statusDl.show();

 

My problem is that dia_answer box. prompts, I select YES, but the dialog box doesnt go away after I click YES and statusDlg doesnt appear at all.

 

I basically want

 

1. dia_answer dialog box to come up., I say yes, the dialog box should disappear.

2. Then statusDlg to come up

3. On successful completion of task, statusDlg should disappear.

 

Kindly appear.

 

Thanks & Regards,

Vijaya S.

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

Re: Dialog box prompt.

Three options based on your code:

 

1) Add your display of statusDlg into your Runnable

UiApplication.getUiApplication().invokeLater( new Runnable() { public void run() {

 

 Dialog dia_answer = new Dialog(Dialog.D_YES_NO,"Are you sure you want to upload a new version of "+filename+" ?",Dialog.YES, Bitmap.getPredefinedBitmap(Bitmap.INFORMATION),Dialog.GLOBAL_STATUS);

if ( dia_answer == Dialog.YES ) {

Dialog statusDlg =  new Dialog("Uploading File...",null,null,0,icon);

UiApplication.getUiApplication.pushScreen(statusDig);

}

}

});

 

2) replace:

UiApplication.getUiApplication().invokeLater

with

UiApplication.getUiApplication().invokeAndWait

and make sure the following code can retrieve the value of dia_answer and use an invokeLater to display statusDlg.

 

3) Use a DialogClosedListener on dia_answer and process from there.