Quote:
Originally Posted by NiLuJe
@pazos: Re-reading the issue and what you said there about STOP, can we actually run Lua code after that event, or will Android say "nope, I'm freezing that activity", hence the potential ANR?
(Looking at the handlers, it's mostly I/O and task (un)scheduling, but code nonetheless ^^).
|
The thread with the LuaJIT instance should be ready to execute chunks of lua when the activity is stopped. Anything network related or window related will fail when the activity isn't in the foreground.
Not very familiar with UIManager, but it looks that both "Suspend" and "Resume" are no-op in Android, so I guess we can remove them:
https://github.com/koreader/koreader...ua#L1761-L1772.
If they're doing something we can broadcast them onResume/onPause instead onStart/onStop.
onStop callback isn't very reliable and most devices never reach that state unless we request an explicit destroy using finish()