5 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
6 #include <QtAndroidExtras>
7 #include <QAndroidJniObject>
8 #define JNIObject QAndroidJniObject
10 #include <QtCore/private/qandroidextras_p.h>
12 #define QtAndroid QtAndroidPrivate
13 #define JNIObject QJniObject
18 static void RunOnMainThread(
const std::function<
void()> &runnable)
20 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
21 QtAndroid::runOnAndroidThread(runnable);
23 QCoreApplication::instance()->nativeInterface<QNativeInterface::QAndroidApplication>()->runOnAndroidMainThread([runnable]()
30 static JNIObject MainActivity()
32 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
33 return QtAndroid::androidActivity();
35 return JNIObject(QCoreApplication::instance()->nativeInterface<QNativeInterface::QAndroidApplication>()->context());
38 static constexpr const char* QtNativePath()
40 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
41 return "org/qtproject/qt5/android/QtNative";
43 return "org/qtproject/qt/android/bindings/QtActivity";