Starting one BlackBerry screen from another.

Posted by DanG on Stack Overflow See other posts from Stack Overflow or by DanG
Published on 2010-04-16T12:20:41Z Indexed on 2010/04/16 12:23 UTC
Read the original article Hit count: 433

Filed under:
|
|
|

I've recently run into a snag while putting on the finishing touches for my BlackBerry app. I'm building a login screen which, if the user is successful in logging in, goes to a data loading screen, and then to a home screen. From the home screen, you can use the app. Everything works great but one thing, I can't seamlessly move from the login screen to the loading screen, to the home screen. I can move from the login screen to the loading screen ok, because I'm doing that via a button click which is on the GUI thread, but then I have the login screen at the bottom of the stack and can't get it out using the dismiss method. Once in the loading screen, I can't push the home screen because I'm not doing it via the gui method, though I'm able to update the GUI via the following piece of code:

   private void checkData(){

            Timer loadingTimer = new Timer();
    TimerTask loadingTask = new TimerTask()
    {

        public void run()
        {
            // set the progress bar
            progressGaugeField.setValue(DataManager.getDataLoaded());

            // for repainting the screen
            invalidate();
        }
    };
    loadingTimer.scheduleAtFixedRate(loadingTask, 500, 500);
}

Does anyone know how to solve my problem of moving seamlessly from the login screen to the loading screen to the home screen? Note: once I'm at the home screen I'd like to have it be the only screen on the stack.

Thanks!

© Stack Overflow or respective owner

Related posts about blackberry

Related posts about gui