Delay splash screen? Crash on SetTimeout?

You must Login before you can answer or comment on any questions.

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);

— answered 4 years ago by Dan Giulvezan
answer permalink
5 Comments
  • Yup. worked for me. I would love to know why the direct call doesn't work. Plus, it would be great if the titanium version of the setTimeout function was documented just somewhere.

    — commented 2 years ago by Brent Wood

  • thanks, worked for me

    — commented 1 year ago by Khaled Kofahi

  • The direct call isn't working because you're not passing a function pointer, but you're simply calling a function. You should have written the function name without the '()', that's to say:

    setTimeout('tabGroup.open', 100);

    — commented 1 year ago by Alfredo Schiappa

  • Show 2 more comments

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!

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

Your Answer

Think you can help? Login to answer this question!