Reputation: 16938
How to build an image-based splash screen for my j2me application?
I already have an application and I need an splash screen to attach with it.
Upvotes: 1
Views: 4944
Reputation: 41510
You can use something like this:
class SplashScreenSwitcher extends Thread {
private Display display;
private Displayable splashScreen;
private Displayable nextScreen;
public SplashScreenSwitcher(Display display, Displayable splashScreen, Displayable nextScreen) {
this.display = display;
this.splashScreen = splashScreen;
this.nextScreen = nextScreen;
}
public void run() {
display.setCurrent(splashScreen);
try {
Thread.sleep(2000); //Here you set needed time or make a constant
} catch (Exception ex) {}
display.setCurrent(nextScreen);
}
}
So, all you do is just create a new instance of this class and start the Thread.
Upvotes: 2
Reputation: 7775
There is no default 'splash screen' method for J2ME, it involves just showing a picture for a few seconds then carrying on with the next display. If you really want you can use the time to load some other things in the background.
This is a tutorial by Sun on splash screens
Upvotes: 3