1

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

4

1 に答える 1

0

Sencha Touch だけではこれを行うことができません。phonegap を使用する必要があります。phonegap を ST2 で動作させるのは非常に簡単です...統合すると、次のように簡単に実行できます。

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

    function myFunctionName() {
        alert('Application has been resumed.');
    }
}
于 2013-08-22T21:07:10.190 に答える