I'm calling a Java function that returns a string:
QAndroidJniObject obj = QAndroidJniObject::callStaticObjectMethod<jstring>("HelloJava", "getString");
jstring jstr = obj.object<jstring>();
QString str = jstr; // This doesn't work, obviously, compiler-error.
And it returns a jstring
, which is not very useful for me. How do I convert that to a QString
, so I can use it in my code?
You need to use this method.
So, I would write this if I were you: