BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 01-23-2009, 12:19 AM   #1 (permalink)
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  
Old 01-23-2009, 03:53 AM   #2 (permalink)
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.
__________________
java developer, Devinto, hamburg/germany
Offline  
Old 01-23-2009, 07:32 AM   #3 (permalink)
New Member
 
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: Alltel
Posts: 6
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





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