Titanium Community Questions & Answer Archive

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

Event on App open after Fast App Switching

Hi,

i was just wondering if there is some event when an app is opened on iOs4 after beeing closed through fast app switching. My idea is to check how old the contents of the current window is and than refresh it if its too old..

I checked to Docs but didnt found anythings..

Any Ideas..?

Thanks,

Jan

— asked July 28th 2010 by Jan Renz
  • app
  • event
  • fast
  • ios4
  • iphone
  • switching
0 Comments

2 Answers

  • you could listen to the app events of 'pause' and 'resume'

    rocksteady,
    danno~

    — answered November 7th 2010 by danno watts
    permalink
    0 Comments
  • Jan

    After you have generated the window and populated with your data, set a property with the current time:

    var refreshTime = (new Date).getTime();
    

    Use a window focus (or possibly open) event to detect when it is being viewed. Compare the new current time with the property:

    var duration = (new Date).getTime() - refreshTime;
    

    If it is longer than your pre-configured delay, refresh the screen's data and reset the refreshTime property.

    Cheers

    Hal

    — answered November 8th 2010 by Paul Dowsett
    permalink
    0 Comments
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.