
Untitled
By: a guest on
May 11th, 2012 | syntax:
None | size: 1.56 KB | hits: 11 | expires: Never
SplashScreen On Blackberry
package main;
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;
import net.rim.device.api.system.*;
import java.util.*;
public class SplashScreen extends MainScreen {
private UiApplication application;
private Timer timer = new Timer();
private static final Bitmap _bitmap = Bitmap.getBitmapResource("SPlachS.png");
public SplashScreen(UiApplication ui) {
super(Field.USE_ALL_HEIGHT | Field.FIELD_LEFT);
this.application = ui;
this.add(new BitmapField(_bitmap));
SplashScreenListener listener = new SplashScreenListener(this);
this.addKeyListener(listener);
timer.schedule(new CountDown(), 5000);
application.pushScreen(this);
}
public void dismiss() {
timer.cancel();
application.popScreen(this);
application.pushScreen(new MyScreen());
}
.....
Thread th = new Thread()
{
public void run()
{
try
{
Thread.sleep(2000);
} catch (Exception ex)
{
}
UiApplication.getUiApplication().invokeLater ( new Runnable()
{
public void run ()
{
UiApplication.getUiApplication().pushScreen(newScreen);
close();
}
}
);
}
};
th.start();