android: handle onDestroy (#6811)

* handle onDestroy

we need it if killed by the system (ie: battery optimizations or OOM)
we need it to exit the lua VM when we call finish() from Kotlin

This prevents us for being trapped into a zombie state
reviewable/pr6816/r1
Martín Fernández 4 years ago committed by GitHub
parent 42b866cd7f
commit 99ad13b13c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1 +1 @@
Subproject commit 5f9e9b7eb39fc98cdacba52d081fe2b559fcfb33
Subproject commit afdd59b2048bde27536bef07e754102840f63850

@ -134,6 +134,8 @@ function Device:init()
logger.dbg("Android application event", ev.code)
if ev.code == C.APP_CMD_SAVE_STATE then
return "SaveState"
elseif ev.code == C.APP_CMD_DESTROY then
UIManager:quit()
elseif ev.code == C.APP_CMD_GAINED_FOCUS
or ev.code == C.APP_CMD_INIT_WINDOW
or ev.code == C.APP_CMD_WINDOW_REDRAW_NEEDED then

Loading…
Cancel
Save