1. #1
    Sencha Premium Member
    Join Date
    Aug 2012
    Posts
    83
    Answers
    2
    Vote Rating
    4
    cydaps is on a distinguished road

      0  

    Default Answered: Sencha Touch 2.2.1 - Detect if app active in iPhone (after unlock or made active app

    Answered: Sencha Touch 2.2.1 - Detect if app active in iPhone (after unlock or made active app


    Hi!

    I've been making fairly good progress with iPhone and Sencha Touch 2.2.1 until I found an issue. I've been using a timer in the background (it's actually an Ext.util.delayedTask) and it works great until the iPhone locks or another app becomes active etc...

    I've been looking at a few ways around this, such as using localStorage to define the timestamp when the timer started and then when the app becomes active again, simply compare the timestamp to current date/time and see what the difference is and perform an action.

    Problem is, I can't for the life of me figure out what I need to call in Sencha Touch 2.2.1 in order to detect whether the app has become the active app again... Can anyone help please!? I've got phonegap installed within the app if that helps at all. I've searched around but can't find anything that clearly defines how to handle this.

    Thanks again!!

  2. With a bit of playing around with it, yes it really is that simple.... tested it on my iPhone and by adding the

    document.addEventListener("resume", myFunction, false);

    When the app becomes active, either after iPhone unlock or when it's the active app again, it triggers this to fire!

    So simple, it seemed as if it had to be more complex than that!!

  3. #2
    Sencha Premium Member
    Join Date
    Aug 2012
    Posts
    83
    Answers
    2
    Vote Rating
    4
    cydaps is on a distinguished road

      0  

    Default


    DOH! Missed the pause, resume in phonegap as wasn't really sure what they were for... it's all new to me so hang on in there! It says I need to bind those events to the document but if I'm in Sencha Touch code, do I still need to bind them to the document and if so, is this done in the app.js in the launch function, and I assume I can just use:


    document.addEventListener("pause", yourCallbackFunction,false);and the same for resume and call a custom function I have in a utility.js file I have set up?

    Thanks

  4. #3
    Sencha Premium Member
    Join Date
    Aug 2012
    Posts
    83
    Answers
    2
    Vote Rating
    4
    cydaps is on a distinguished road

      0  

    Default It really was that simple!!

    It really was that simple!!


    With a bit of playing around with it, yes it really is that simple.... tested it on my iPhone and by adding the

    document.addEventListener("resume", myFunction, false);

    When the app becomes active, either after iPhone unlock or when it's the active app again, it triggers this to fire!

    So simple, it seemed as if it had to be more complex than that!!

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi