View Single Post
Old 01-22-2009, 11:19 PM   #1 (permalink)
debapriya.ray
New Member
 
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: Alltel
Posts: 6
Post Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation progress bar implementation

Please Login to Remove!

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();
}
});

}


}
Offline   Reply With Quote