Domanda

I would like to know if a event is fired, when I switch to another app or the homescreen respectively if the app is reopened?

I'm not using PhoneGap, but only Sencha native packaging (which uses NimbleKit I guess). On the debugging console, I can see

stbuild_template[1087:c07] onDeviceResume -1

and in my code (in app.js launch event) I add an event listener:

document.addEventListener("onDeviceResume",function(){alert("I'm Back");},false);

But the event isn't fired. What do I wrong?

Thanks and best regards

È stato utile?

Soluzione

Sencha Touch cannot do this alone, you'll have to use phonegap. It's quite easy to get phonegap working with ST2... once you've integrated it you can easily do this like so:

launch: function() {
    document.addEventListener('resume', myFunctionName, false);

    function myFunctionName() {
        alert('Application has been resumed.');
    }
}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top