Delay splash screen? Crash on SetTimeout?
Hi!
I have an app where I want to keep the loading splashscreen longer than the default time. (don't ask…).
I tried:
setTimeout('tabGroup.open()',100);
However, this crashes the app on startup.
The only error I get is [DEBUG] Session did end with error (null).
Any insight on why it's crashing? And/or another way to have the splashscreen slow longer?
(yeah, I know it's a strange question. Client wants it that way…).
9 Answers
-
Accepted Answer
Give it a shot like this, seemed to work when I tried it:
setTimeout(function() { tabGroup.open(); }, 5000);
-
Only way I can think of at the moment to make it visible longer would be to create an image view that looks just like the splash and have that be the first thing you see when the splash screen closes, then put your timer on that new image view.
-
That would be another way to do it. However, the spashscreen stays up until I call tabgroup.open(). Why can't I just wait for a bit with that?
-
The splash screen closes as soon as it enters line 1 of the coding, which in your case was "setTimeout".
-
Not entirely true: If I don't open the tabgroup (but do creat the tabs, etc), there are lines of code, but the splashscreen does stay up….
-
Yea, you're right, I apologize. I'm with you here, this makes no sense..
-
Awesome. No idea why it doesn't work with the direct call, or with a real function. I did try:
function opentabs() { tabGroup.open(); } setTimeout(opentabs(),100);
And that also crashes.
Somehow, you'rs doesn't! Thanks! -
Thanks, this worked for me also.
-
Hi. Thanks for the help guys. I would like to start off my app with an animated splash screen. The way I can think of right now is by setting the splash screen to the 0th frame and continuing the animation in image views. Is there a better mehod ? Also, how can i reduce the time of my splash screen.. Thanks