BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 10-28-2008, 04:57 PM   #1 (permalink)
New Member
 
Join Date: Oct 2008
Model: 8800
PIN: N/A
Carrier: Alltel
Posts: 12
Post Thanks: 0
Thanked 0 Times in 0 Posts
Question How do I get the close status of a screen "invokeLater"ed?

Please Login to Remove!

I have a Screen (AuthScreen) that extends PopupScreen to handle application start-up issues like authentication and/or account creation.

Currently, I have MyApp extends UiApplication. Then, I have my main screen being pushed in the constructor of MyApp.

Then, I have my AuthScreen invoked in the main screen constructor with: UiApplication.getUiApplication().invokeLater(new Runnable()...)

This arrangement works pretty well but I'm not able to figure out a good way to get any information about the AuthScreen return status. For instance, if the user cancels out of the AuthScreen, I want to close the application.

In general, I need to know how to retrieve values from the "Runnable" after it closes and then call "onClose()" in the application if I need to. Or, a different solution completely.
Offline  
Old 10-28-2008, 08:59 PM   #2 (permalink)
CrackBerry Addict
 
Join Date: May 2005
Location: Golden, CO US
Model: 9700
Carrier: ATT
Posts: 684
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Why don't you just have the runnable call close() (or any other method) on the app main screen when appropriate?
Offline  
Old 10-28-2008, 09:08 PM   #3 (permalink)
New Member
 
Join Date: Oct 2008
Model: 8800
PIN: N/A
Carrier: Alltel
Posts: 12
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I tried a few other things that led to RuntimeExceptions but I guess I never tried this (which works). I was afraid I'd "chop my legs off" so to speak.

A method of my MyPopupScreen:

Code:
    public void close()
    {
        UiApplication.getUiApplication().popScreen(this);
        UiApplication.getUiApplication().getActiveScreen().close();
    }
Offline  




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