Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.11.1
-
Android 6.0.1
-
-
f7df383a284e2189f0137efd9d9496f2be79566b
Description
When getting the Intent from an Activity, and trying to create an QAndroidIntent from the corresponding QAndroidJniObject, my application crashes with an "JNI DETECTED ERROR IN APPLICATION: jarray was NULL" error.
Source:
QAndroidJniObject activityObj = QtAndroid::androidActivity(); QAndroidJniObject intentObj = activityObj.callObjectMethod("getIntent", "()Landroid/content/Intent;"); if (intentObj.isValid()) { QAndroidIntent startupIntent(intentObj); // crashes here QVariant val = startupIntent.extraVariant("MyStartupValue"); }
Getting Intent extras by jni calls instead works fine:
QAndroidJniObject extrasObj = intentObj.callObjectMethod("getStringExtra", "(Ljava/lang/String;)Ljava/lang/String;", QAndroidJniObject::fromString(name).object<jstring>());
Attachments
For Gerrit Dashboard: QTBUG-70284 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
240745,2 | Check if the array is valid before accessing it | 5.11 | qt/qtandroidextras | Status: MERGED | +2 | 0 |