I have the main activity which launches a "loading screen" activity. When the "loading screen" finishes, I need to show a kind of a splash-screen, and naturally I chose Dialog class to do so. But when I call for showDialog
from onResume
the application fails even though I understand from all the related posts that this is the proper way to do it.
Can anyone point me to the right direction?
Here's a code sample, if it helps:
@Override
protected Dialog onCreateDialog(int id) {
switch (id) {
case DIALOG_SPLASH:
promo = new PromoSplashScreen(getAppContext(), R.style.NoFrameNoBorderBoTitle);
promo.setCancelable(false);
promo.setImage(ApplicationData.config.splashImageURL);
return promo;
default:
return super.onCreateDialog(id);
}
}
@Override
protected void onResume() {
super.onResume();
if (ApplicationData.config == null) return;
if (ApplicationData.config.splashEnabled && !ApplicationData.config.splashPlayed && ApplicationData.config.splashImageURL != "") {
// Play splash screen
ApplicationData.config.splashPlayed = true;
showDialog(DIALOG_SPLASH);
}
}