Re: How to end SDLActivity correctly

hardcoredaniel <[email protected]> Wed, 14 Dec 2016 18:28:48 +0100 (CET)
Newsgroups gmane.comp.lib.sdl
Message-ID <[email protected]>
You cannot completely "exit" an Activity on Android (like on Windows or 
other OSes where exit() resp. return from main unloads the program from 
memory). Android will decide for itself whether and when to remove an 
Activity from memory. Think of it like files that an OS will cache in memory
for performance reasons - Android does the same with Activities.

An Activity being in the "destroyed" state should however not behave 
differently when started, compared to an Activity that has not been started 
before. And yes, Android apps should always be restartable, because you'll 
never know whether the app was removed from memory in the meantime. This 
might need special attention (like no static initialization in native code, 
and SDLActivity re-initializing some fields upon onDestroy() already, which 
looks strange but is correct). 



---------- Původní zpráva ----------
Od: Edition Chamäleon <[email protected]>
Komu: [email protected]
Datum: 14. 12. 2016 17:15:31
Předmět: Re: [SDL] How to end SDLActivity correctly

" 

Hi Daniel,

thank you for your fast answer. Resuming my app, when it is paused via 
homebutton works fine. But the exitbutton that I want to implement should 
kill the app complete and shut it down.
As I wrote I'm killing all of my native app, when the exitbutton is 
triggered by the user, therefore it isn't restartable anymore. Is that a 
wrong way?
Michael

_______________________________________________ 
SDL mailing list 
[email protected] 
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org 
"

_______________________________________________
SDL mailing list
[email protected]
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org