'applicationStart' 工作,但 'applicationResume' 不起作用,我已经设置了“UIApplicationExitsOnSuspend = false”。同样奇怪的是,它实际上可以在 Corona Simulator 上运行,但不能在真实设备(iPhone5/iOS6)上运行。
这是代码:
local onSystem = function( event )
if event.type == "applicationStart" then
system.cancelNotification()
native.setProperty( "applicationIconBadgeNumber",0)
elseif event.type == "applicationExit" then
print("exit")
elseif event.type == "applicationSuspend" then
print("suspend")
elseif event.type == "applicationResume" then
native.showAlert( "Hihi", "", { "OK" } )
end
end
-- setup a system event listener
Runtime:addEventListener( "system", onSystem )
有任何想法吗??
我发现了另一个事件处理程序代码:
local function onSystemEvent( event )
if event.type == "applicationStart" then
--fb.logout();
return true
end
if event.type == "applicationExit" then
--fb.logout();
return true
end
end