Hi,
yes, you cannot prevent Android from killing your app. And yes, I was
referring to the entries in the manifest to disable a lifecycle event for
rotation and keyboard.
With these events disabled, I believe you will never get a onDestroy() call
from the system, only the one that SDLActivity generates itself when the C
main() function terminates. Then, Thread.join() must always succeed.
To get rid of issues when onCreate() is called but your app was not
terminated before (so some old state might have been be stored), there has
been a suggestion on this list some time ago, to put your code into a shared
library that is dlopen()ed when your C main is called, and closed (e.g.
unloaded) before your main exits.
This way, you will either be unloading your library yourself, or Android
will kill you when you are backgrounded. But there should not be any case
anymore that you suffer from states of a previous run when entering onCreate
()
?
---------- P?vodn? zpr?va ----------
Od: vroad
Komu: sdl at lists.libsdl.org
Datum: 11. 6. 2016 2:38:18
P?edm?t: Re: [SDL] SDLActivity fails to finish thread in onDestroy
"
It turned out that Android may kill app’s process at any time after onPause
is called, even if it’s in the middle of execution, so you should save app’s
state when onPause is called, or maybe you can use servlce. Service doesn’t
prevent Activity from getting destroyed, but I think it will prevent process
from getting killed.
I don’t think you can prevent Activity from getting destroyed by Android OS.
Android may kill Activity at any time after app goes background. You can see
what happens in this case by enabling “Don’t keep activities” in developer
options.
Which flag are you talking about? I can prevent Activity from being
destroyed when device is roated, and when software keyboard is shown, but
that doesn’t solve this service._______________________________________________
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org"