create ContentProvider from AndroidManifest.xml

This is required for androidx startup library.
Only onCreate method is called for now.
This commit is contained in:
Julian Winkler
2023-09-13 21:34:24 +02:00
parent f5fc993484
commit 55a1ff2cc5
5 changed files with 64 additions and 2 deletions

View File

@@ -357,6 +357,11 @@ static void open(GtkApplication *app, GFile** files, gint nfiles, const gchar* h
prepare_main_looper(env);
jclass content_provider = (*env)->FindClass(env, "android/content/ContentProvider");
(*env)->CallStaticObjectMethod(env, content_provider, _STATIC_METHOD(content_provider, "createContentProviders", "()V"));
if((*env)->ExceptionCheck(env))
(*env)->ExceptionDescribe(env);
(*env)->CallVoidMethod(env, application_object, _METHOD(handle_cache.application.class, "onCreate", "()V"));
if((*env)->ExceptionCheck(env))
(*env)->ExceptionDescribe(env);