1

I need to display a splash screen when I app instantiate, I wrote a class for splashScreen based on blackberry develpers knowlwdebase (link).

And its invoked from my following class.My problem is the splashscreen appears only after a deley,How can I solve it,If any one have idea Please help me,Thanks

class Test extends MainScreen{

Test(){

UiApplication.getUiApplication().invokeLater(new Runnable() 
        {
            public void run() {
                UiApplication app=(UiApplication)getApplication();

                Bitmap image = Bitmap.getBitmapResource("splah.png");
                ListView listView = new ListView();
                new SplashScreen(app, listView );

}

}
Rex Nihilo
  • 604
  • 2
  • 7
  • 16
Jisson
  • 3,566
  • 8
  • 38
  • 71

1 Answers1

2

Try synchronized (UiApplication.getEventLock()). It is faster than invokeLater.

Test(){
synchronized (UiApplication.getEventLock()) {
UiApplication app=(UiApplication)getApplication();
Bitmap image = Bitmap.getBitmapResource("splah.png");
ListView listView = new ListView();
new SplashScreen(app, listView );

}

}
oxigen
  • 6,263
  • 3
  • 28
  • 37