【发布时间】:2012-02-14 19:11:33
【问题描述】:
当设备进入睡眠状态时,我的电晕应用程序无法运行。没有按钮没有响应继续我的游戏。 我使用以下代码来跟踪系统事件 .当屏幕关闭时它会打印 applicationSuspend 但在屏幕上它永远不会打印“applicationResume”[使用 android adb eclipse 来显示打印消息]
local function onSystemEvent( event )
if( event.type == "applicationExit" ) then
print("applicationExit")
db:close()
elseif event.type == "applicationSuspend" then
print("applicationSuspend")
elseif event.type == "applicationResume" then
print("applicationResume")
elseif event.type == "applicationStart" then
print("applicationStart")
end
end
有什么办法吗?
【问题讨论】:
-
请包含“周围”的代码,如果。比如它在什么函数里。
-
@kikito 我将它包含在 main.lua 中...不需要特殊功能..\
-
尝试完全使用 Shane 的代码。我怀疑您的问题可能是您的某个 if 中的某种错字。
-
@kikito 我使用了 Shane Gadsby 的代码,但 applicationResume 从未调用过,但所有其他 3 个都根据事件工作
-
那我不知道你还能做什么。您是否尝试在 Corona SDK 论坛上发布您的问题?