BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 02-11-2009, 02:13 AM   #1
GasBot
Knows Where the Search Button Is
 
Join Date: Nov 2008
Model: Pearl
PIN: N/A
Carrier: T-Mobile
Posts: 22
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
simon.hain
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
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
GasBot
Knows Where the Search Button Is
 
Join Date: Nov 2008
Model: Pearl
PIN: N/A
Carrier: T-Mobile
Posts: 22
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
GasBot
Knows Where the Search Button Is
 
Join Date: Nov 2008
Model: Pearl
PIN: N/A
Carrier: T-Mobile
Posts: 22
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
simon.hain
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
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



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


LCD Digital Multimeter Voltmeter Ammeter Ohmmeter Volt AC DC Tester Leads Meter picture

LCD Digital Multimeter Voltmeter Ammeter Ohmmeter Volt AC DC Tester Leads Meter

$9.95



Digital Multimeter AC DC Voltmeter Ammeter Ohmmeter Volt Tester Meter DM850 picture

Digital Multimeter AC DC Voltmeter Ammeter Ohmmeter Volt Tester Meter DM850

$7.95



US Stock AC 0~50A Analog AMP Current Panel Meter Ammeter & Current Transformer picture

US Stock AC 0~50A Analog AMP Current Panel Meter Ammeter & Current Transformer

$21.49



Multifunction Digital Multimeter 1999 Counts AC/DC Volt Current Ohm Tester Meter picture

Multifunction Digital Multimeter 1999 Counts AC/DC Volt Current Ohm Tester Meter

$9.95



Genuine Husqvarna 532122822 Ammeter 15 AMP Fits Craftsman AYP 121433X 122822X picture

Genuine Husqvarna 532122822 Ammeter 15 AMP Fits Craftsman AYP 121433X 122822X

$19.58



LCD Digital Multimeter Voltmeter Ammeter Ohmmeter Volt AC DC Tester Leads Meter picture

LCD Digital Multimeter Voltmeter Ammeter Ohmmeter Volt AC DC Tester Leads Meter

$6.95







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