Fixed bug 3511 - documentation to end an Android application
authorSylvain Becker <sylvain.becker@gmail.com>
Sun, 30 Dec 2018 14:23:25 +0100
changeset 12487b2422f30f0a6
parent 12486 7c0e0a340fc2
child 12488 55f828c2af46
Fixed bug 3511 - documentation to end an Android application
docs/README-android.md
     1.1 --- a/docs/README-android.md	Sat Dec 29 17:59:34 2018 +0100
     1.2 +++ b/docs/README-android.md	Sun Dec 30 14:23:25 2018 +0100
     1.3 @@ -409,6 +409,24 @@
     1.4  
     1.5  
     1.6  ================================================================================
     1.7 + Ending your application
     1.8 +================================================================================
     1.9 +
    1.10 +Two legitimate ways:
    1.11 +
    1.12 +- return from your main() function. Java side will automatically terminate the
    1.13 +Activity by calling Activity.finish().
    1.14 +
    1.15 +- Android OS can decide to terminate your application by calling onDestroy()
    1.16 +(see Activity life cycle). Your application will receive a SDL_QUIT event you 
    1.17 +can handle to save things and quit.
    1.18 +
    1.19 +Don't call exit() as it stops the activity badly.
    1.20 +
    1.21 +NB: "Back button" can be handled as a SDL_KEYDOWN/UP events, with Keycode
    1.22 +SDLK_AC_BACK, for any purpose.
    1.23 +
    1.24 +================================================================================
    1.25   Known issues
    1.26  ================================================================================
    1.27