Hi @Odijack,
As I mentioned in the post near the top, you won’t get the “applicationSuspend” event on/before a forced termination, because it immediately halts the Runtime and there is no opportunity to read the event that was sent to the system until you restart the app.
Also, can you test out this pause function? It uses a “gamePaused” flag, which is just a boolean that you set in the beginning (to false, obviously). Notice how on the “resume” event, it doesn’t actually try to resume the game itself. Instead, it assumes that (on pause) you’ll be bringing up some kind of pause menu with a button to resume the game. So, on resume, the app continues in the paused state… you game’s paused state, not internally paused by the OS… and then you click the button to resume, in a tap listener that calls the “pausegame()” function. In that function, I handle both the pause and un-pause functionality, based on the “gamePaused” flag state, swapping it between true/false depending on the starting condition.
[lua]
local function devicePause( event )
if ( “applicationSuspend” == event.type ) then
audio.pause( 0 )
if ( gamePaused == false ) then
pausegame()
else
print(“NO RE-PAUSE (FROM DEVICE SUSPEND)”)
end
elseif ( “applicationResume” == event.type ) then
audio.resume( 0 )
end
end
Runtime:addEventListener( “system”, devicePause )
[/lua]