Hi,
You can use the system events to check for the various states (start, suspend, resume, etc.) using the “system” runtime event listener.
Store the timer value on suspend and on resume check to see if over 20 seconds has elapsed and immediately move on, or whatever your logic is after a question timeout.
local last\_time = os.time() local function onSystemEvent( e ) if e.type == "applicationSuspend" then --HTML5 app is being paused last\_time = os.time() elseif e.type == "applicationResume" then --HTML5 app has started again. local elasped = os.difftime(os.time(), last\_time) print(elasped) --\> seconds elapsed end end Runtime:addEventListener("system", onSystemEvent)
-dev