diff -r dbc789caf67b -r 1d81826ee9c8 src/core/android/SDL_android.cpp --- a/src/core/android/SDL_android.cpp jue dic 15 11:09:28 2011 -0300 +++ b/src/core/android/SDL_android.cpp mié dic 28 15:17:38 2011 -0300 @@ -167,6 +167,35 @@ SDL_SendQuit(); } +// Pause +extern "C" void Java_org_libsdl_app_SDLActivity_nativePause( + JNIEnv* env, jclass cls) +{ + if (Android_Window) { + SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_HIDDEN, 0, 0); + SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_FOCUS_LOST, 0, 0); + } +} + +extern "C" void Java_org_libsdl_app_SDLActivity_nativeResume( + JNIEnv* env, jclass cls) +{ + if (Android_Window) { + SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_SHOWN, 0, 0); + SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_FOCUS_GAINED, 0, 0); + } +} + extern "C" void Java_org_libsdl_app_SDLActivity_nativeRunAudioThread( JNIEnv* env, jclass cls) { diff -r dbc789caf67b -r 1d81826ee9c8 src/main/android/SDL_android_main.cpp --- a/src/main/android/SDL_android_main.cpp jue dic 15 11:09:28 2011 -0300 +++ b/src/main/android/SDL_android_main.cpp mié dic 28 15:17:38 2011 -0300 @@ -33,8 +33,8 @@ argv[1] = NULL; status = SDL_main(1, argv); - /* We exit here for consistency with other platforms. */ - exit(status); + /* Do not issue an exit or the whole application will terminate instead of just the SDL thread */ + //exit(status); } #endif /* __ANDROID__ */