문제

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

도움이 되었습니까?

해결책

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.');
    }
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top