From 309596c10d86acd165b2ffbe5dcfa79e157bec91 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 31 Jan 2016 17:20:54 +0200 Subject: [PATCH] Provide access to the Java VM on Android --- source/core/android/mainthread.cpp | 8 ++++++++ source/core/android/mainthread.h | 1 + 2 files changed, 9 insertions(+) diff --git a/source/core/android/mainthread.cpp b/source/core/android/mainthread.cpp index 255eaa3..8ce484a 100644 --- a/source/core/android/mainthread.cpp +++ b/source/core/android/mainthread.cpp @@ -51,6 +51,14 @@ void MainThread::resume_startup() } } +JavaVM *MainThread::get_java_vm() const +{ + if(!activity) + return 0; + + return activity->vm; +} + void MainThread::set_window_flags(unsigned set, unsigned clear) { ANativeActivity_setWindowFlags(activity, set, clear); diff --git a/source/core/android/mainthread.h b/source/core/android/mainthread.h index 22309ee..609300f 100644 --- a/source/core/android/mainthread.h +++ b/source/core/android/mainthread.h @@ -34,6 +34,7 @@ public: void wait_for_app_created(); void resume_startup(); + JavaVM *get_java_vm() const; AAssetManager *get_asset_manager() const { return asset_manager; } const FS::Path &get_internal_data_path() const { return int_data_path; } -- 2.45.2