implement Activity.onPostCreate() and onPostResume()

These are used by androidx to handle the Fragment lifecycle
This commit is contained in:
Julian Winkler
2024-10-05 16:52:53 +02:00
parent 21a75d7ff0
commit 1b46d728e3
4 changed files with 22 additions and 0 deletions

View File

@@ -54,6 +54,10 @@ static void activity_focus(JNIEnv *env, jobject activity)
if((*env)->ExceptionCheck(env))
(*env)->ExceptionDescribe(env);
(*env)->CallVoidMethod(env, activity, handle_cache.activity.onPostResume);
if((*env)->ExceptionCheck(env))
(*env)->ExceptionDescribe(env);
(*env)->CallVoidMethod(env, activity, handle_cache.activity.onWindowFocusChanged, true);
if((*env)->ExceptionCheck(env))
(*env)->ExceptionDescribe(env);
@@ -129,6 +133,10 @@ void _activity_start(JNIEnv *env, jobject activity_object, bool recreate)
return;
}
(*env)->CallVoidMethod(env, activity_object, handle_cache.activity.onPostCreate, NULL);
if((*env)->ExceptionCheck(env))
(*env)->ExceptionDescribe(env);
if(recreate) // only allowed for toplevel, so we know for sure where in the stack it belongs
activity_backlog = g_list_append(activity_backlog, _REF(activity_object));
else