BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 02-11-2009, 02:13 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Nov 2008
Model: Pearl
PIN: N/A
Carrier: T-Mobile
Posts: 22
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default How can I show a modal dialog as a status screen?

Please Login to Remove!

When my app first starts up, I have it calling my web service and looking to see if there are any updates to the app. I would like to let the user know this by having the screen grayed out with a message saying that the app is checking for updates which doesn't allow them to do anything until a response has been returned. I'm seeing a bunch of stuff about the PopupScreen, but am having trouble implementing it. Anyone have any working code for this?
Offline  
Old 02-11-2009, 05:32 AM   #2 (permalink)
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

popupscreen is a quite easy to use class. just create a manager, put it into the popupscreen and use pushModalScreen to "block" the application from input.

you have to include elements that close the screen, of course. for example overwrite navigationclick or keychar etc
__________________
java developer, Devinto, hamburg/germany
Offline  
Old 02-12-2009, 02:47 AM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: Nov 2008
Model: Pearl
PIN: N/A
Carrier: T-Mobile
Posts: 22
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by simon.hain View Post
popupscreen is a quite easy to use class. just create a manager, put it into the popupscreen and use pushModalScreen to "block" the application from input.

you have to include elements that close the screen, of course. for example overwrite navigationclick or keychar etc
Sorry, I'm pretty new to BlackBerry development, but do I have to use the VerticalFieldManager as the manager for a PopupScreen? Here's the code that I have so far, I'm assuming I need to change my last line to the pushModalScreen function?

Code:
final VerticalFieldManager mgr = new VerticalFieldManager(VerticalFieldManager.NO_HORIZONTAL_SCROLLBAR | 
                                                                  VerticalFieldManager.NO_VERTICAL_SCROLLBAR | 
                                                                  VerticalFieldManager.USE_ALL_HEIGHT | 
                                                                  VerticalFieldManager.USE_ALL_WIDTH);
        PopupScreen pps = new PopupScreen(mgr, PopupScreen.DEFAULT_CLOSE);
        getScreen().getUiEngine().pushScreen(pps);
Offline  
Old 02-12-2009, 03:10 AM   #4 (permalink)
Knows Where the Search Button Is
 
Join Date: Nov 2008
Model: Pearl
PIN: N/A
Carrier: T-Mobile
Posts: 22
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

So it turns out that I can't use pushModalScreen because that stops the code from executing further. I changed it over to pushScreen which didn't stop the code from executing, but I didn't see the PopupScreen. Does anyone have some example code of a PopupScreen used just as a status screen to keep the user from doing anything while the background processing is going and then having the app automatically close the popup when it was done with the operation?
Offline  
Old 02-12-2009, 04:25 AM   #5 (permalink)
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

use invokelater to put your ui access into the event queue, your app will continue to run.
use pushModalScreen to block the input to your app
__________________
java developer, Devinto, hamburg/germany
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.