'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