aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/androidextras/jni/qandroidjnienvironment.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/androidextras/jni/qandroidjnienvironment.cpp b/src/androidextras/jni/qandroidjnienvironment.cpp
index 585c442..ddb3f4e 100644
--- a/src/androidextras/jni/qandroidjnienvironment.cpp
+++ b/src/androidextras/jni/qandroidjnienvironment.cpp
@@ -93,6 +93,21 @@ QT_BEGIN_NAMESPACE
Returns the class pointer or null if is not found.
+ A use case for this function is searching for a custom class then calling
+ its memeber method. The following code snippet create an instance of the
+ class \c CustomClass and then calls \c printFromJava() method:
+
+ \code
+ QAndroidJniEnvironment env;
+ jclass javaClass = env.findClass("org/qtproject/example/qtandroidextras/CustomClass");
+ QAndroidJniObject classObject(javaClass);
+
+ QAndroidJniObject javaMessage = QAndroidJniObject::fromString("findClass example");
+ classObject.callMethod<void>("printFromJava",
+ "(Ljava/lang/String;)V",
+ javaMessage.object<jstring>());
+ \badcode
+
\since Qt 5.12
*/