2016-06-24 5 views
0

코드에서 앱을 일시 중지 할 수있는 방법이 있습니까? 시뮬레이터에서 Win + 화살표를 누른 것과 같습니다. 어쩌면 어떤 사건일까요? 디버그 용으로 만 사용하기 때문에 시뮬레이터에서 작동해야합니다.코로나 강제 종료 앱

답변

0

시스템 이벤트를 "처리"할 수는 있지만 코드로 앱을 일시 중지 할 수는 없습니다.

-- create a function to handle all of the system events 
local onSystem = function(event) 
    if event.type == "applicationStart" then 
     print("start") 
    elseif event.type == "applicationExit" then 
     print("exit") 
    elseif event.type == "applicationSuspend" then 
     print("suspend") 
    elseif event.type == "applicationResume" then 
     print("resume") 
    end 
end 

-- setup a system event listener 
Runtime:addEventListener("system", onSystem)