我的应用程序从睡眠或挂起状态唤醒后无法运行
当设备进入睡眠状态时,我的 Corona 应用程序无法运行。没有按钮,没有任何反应来继续我的游戏。 我使用以下代码来跟踪系统事件 。当屏幕关闭时,它会打印 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
有什么解决方案吗?
My corona app is not working when device go to sleep state. no buttons nothing is responding to continue my game.
I used following code to keep track the system event
. When screen off it prints applicationSuspend but after screen on it never prints the "applicationResume" [Used android adb eclipse to display print messages]
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
Any Solution?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我确信 Kikito 已经指出了;我们可能需要先拥有它内部的功能,然后才能提供更多帮助。
据我所知,此事件类型只能在 a:
Styled 函数内使用。
你就是这样使用的吗?
As I'm sure Kikito was pointing out; We probably need to have the function it's inside before we can help more.
as far as I know, this event type can only be used inside a:
Styled function.
Is this the way you're using it?