BlackBerry Forums Support Community

BlackBerry Forums Support Community (http://www.blackberryforums.com/)
-   Developer Forum (http://www.blackberryforums.com/developer-forum/)
-   -   progress bar implementation (http://www.blackberryforums.com/developer-forum/172083-progress-bar-implementation.html)

debapriya.ray 01-22-2009 11:19 PM

progress bar implementation
 
I have 2 screens that extend main screen.From one I call the other thru pushModalScreen..In the first I have called a thread that executes for sometime and then It automatically moves to the second.Now thruout this time I want to show a progress bar so tht the user sees tht something's happening.can you please tell me how to...The ist screen code is


The ist screen is splash and the second login........................



public class Splash extends UiApplication {
static boolean first = false;
static SplashScreen splashS;

public static void main(String[] args) {
if (!first) {
Splash theApp = new Splash();
System.out.println("Splash screen entered ");
theApp.enterEventDispatcher();
first = true;

}

}

public Splash() {
SplashScreen splashS = new SplashScreen();

pushScreen(splashS);

}

}

final class SplashScreen extends MainScreen {

boolean m_bSplashActive = true;
long m_dwSplashTime = 2000;
boolean m_bPaused = false;

public SplashScreen() {

super();

LabelField title = new LabelField("Mobile Banking", LabelField.ELLIPSIS
| LabelField.USE_ALL_WIDTH);
setTitle(title);
add(new SeparatorField());
add(new RichTextField("Welcome!", RichTextField.NON_FOCUSABLE));

Bitmap myBitMap=Bitmap.getBitmapResource("mb.JPG");
BitmapField bitmapField=new BitmapField(myBitMap);
add(bitmapField);
add(new SeparatorField());


nextPage();

invalidate();
}



public boolean onClose() {
Dialog.alert("You are exiting the application!");
System.exit(0);
return true;
}

public static void nextPage() {
UiApplication.getUiApplication().invokeLater(new Runnable() {
public void run() {
UiApplication.getUiApplication().getActiveScreen() .invalidate();
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
showLoginScreen();
}
});

}


}

simon.hain 01-23-2009 02:53 AM

for progressscreens i use a popupscreen. you can use a gaugefield or implement similar behaviour with timertask and the draw method.
or you can use an animation via a series of pictures that are changed, again using a timertask.

debapriya.ray 01-23-2009 06:32 AM

Thank you


All times are GMT -5. The time now is 06:16 AM.

Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.