Starting one BlackBerry screen from another.
- by DanG
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!