From d09774a47cccfc539c5cbf263809bea22553aef2 Mon Sep 17 00:00:00 2001 From: Sylvain Becker Date: Sun, 30 Dec 2018 14:23:25 +0100 Subject: [PATCH] Fixed bug 3511 - documentation to end an Android application --- docs/README-android.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/README-android.md b/docs/README-android.md index 0aa90e70b624a..585a5e25c8b24 100644 --- a/docs/README-android.md +++ b/docs/README-android.md @@ -408,6 +408,24 @@ screen each frame. Reference: http://www.khronos.org/registry/egl/specs/EGLTechNote0001.html +================================================================================ + Ending your application +================================================================================ + +Two legitimate ways: + +- return from your main() function. Java side will automatically terminate the +Activity by calling Activity.finish(). + +- Android OS can decide to terminate your application by calling onDestroy() +(see Activity life cycle). Your application will receive a SDL_QUIT event you +can handle to save things and quit. + +Don't call exit() as it stops the activity badly. + +NB: "Back button" can be handled as a SDL_KEYDOWN/UP events, with Keycode +SDLK_AC_BACK, for any purpose. + ================================================================================ Known issues ================================================================================