From db28a94d499f995b467b07cee5c9b9119f538b1c Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Thu, 21 Oct 2010 17:22:30 -0700 Subject: Fix issue #3117918: No way to finish a native activity Change-Id: Ic53e712f7ab5412d72a31b96ecba252344b91644 --- native/android/native_activity.cpp | 4 ++++ native/include/android/native_activity.h | 6 ++++++ 2 files changed, 10 insertions(+) (limited to 'native') diff --git a/native/android/native_activity.cpp b/native/android/native_activity.cpp index 0c6823a..056255f 100644 --- a/native/android/native_activity.cpp +++ b/native/android/native_activity.cpp @@ -21,6 +21,10 @@ using namespace android; +void ANativeActivity_finish(ANativeActivity* activity) { + android_NativeActivity_finish(activity); +} + void ANativeActivity_setWindowFormat(ANativeActivity* activity, int32_t format) { android_NativeActivity_setWindowFormat(activity, format); } diff --git a/native/include/android/native_activity.h b/native/include/android/native_activity.h index d74e1ce..a8f11c9 100644 --- a/native/include/android/native_activity.h +++ b/native/include/android/native_activity.h @@ -227,6 +227,12 @@ typedef void ANativeActivity_createFunc(ANativeActivity* activity, */ extern ANativeActivity_createFunc ANativeActivity_onCreate; +/** + * Finish the given activity. Its finish() method will be called, causing it + * to be stopped and destroyed. + */ +void ANativeActivity_finish(ANativeActivity* activity); + void ANativeActivity_setWindowFormat(ANativeActivity* activity, int32_t format); void ANativeActivity_setWindowFlags(ANativeActivity* activity, -- cgit v1.1