Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Android: show splash on application resume

Hi,

I need to show a fulscreen "splash" (for advertising) when my application resume. No problem for iOS, but I can't do it work on Android.

Here is the code I use : http://www.pastie.org/2410338

The "splash window" seems to open (if I add log informations), but is not visible.
Something about activities and contexts, I think, but I don't find a better way to do it…

It works fine on startup, but not on resume (after a pause in background)

Does anyone have an idea to do it ?

Thanks.

Joel

— asked August 29th 2011 by Joel Bohrer
  • android
  • resume
  • splash
0 Comments

1 Answer

  • In your addEventListener, change 'start' to 'resume'.

    — answered August 29th 2011 by Adam Paxton
    permalink
    3 Comments
    • Thanks for the answer, but it doesn't work. "Resume" events is fired each time I change tab, and it's not what I want.

      The scenario is :

      • application starts, a fullscreen ad is shown

      • user navigates in tabs, tabs can open new windows, etc. So, many activities can be started.

      • user press the "Home" button, so the application goes to background. And all activities stop

      • user restart application, the current tab wakes up (and its activity start), and at this moment I want to show a fullscreen ad.

      My monitor function works and catch the "resume event". But the splash window is not visible. It seems to stay "behind".

      I hope it's more clear now.

      Thanks for your help…

      — commented August 29th 2011 by Joel Bohrer
    • I'm not sure what you mean by 'behind'. Do you mean behind other views? If so, have you tried setting the zIndex property on the view?

      On the resume firing to frequently, maybe you can set a flag in the pause event, then check for the flag on resume, and only open the splash screen when the flag is set.

      — commented August 29th 2011 by Adam Paxton
    • Well, even with the resume event, the window is not visible. And it's not a problem of zIndex.

      I think it's something about the main activity (app.js) which stop when the tabGroup is open.

      If you have a few minutes, copy the code in a new application, add some logs in the monitor function, and run it in Android Emulator. You'll see that the function is called, but the window is not visible.

      — commented August 29th 2011 by Joel Bohrer
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.