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
This commit is contained in:
Martín Fernández
2020-10-22 20:18:36 +02:00
committed by GitHub
parent 42b866cd7f
commit 99ad13b13c
2 changed files with 3 additions and 1 deletions

2
base

Submodule base updated: 5f9e9b7eb3...afdd59b204

View File

@@ -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