有没有办法暂停代码中的应用?就像在模拟器上按下Win +向下箭头一样。有些事可能吗?我想将它用于调试,因此它必须在模拟器上工作。
答案 0 :(得分: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 )