Adding support for java.lang.Long values in Android GodotLib.calldeferred calls

This commit is contained in:
Simon Sikström 2018-11-20 13:07:24 +01:00
parent 40765302c6
commit 00b57d3bd2

View file

@ -268,11 +268,11 @@ Variant _jobject_to_variant(JNIEnv *env, jobject obj) {
return ret; return ret;
}; };
if (name == "java.lang.Integer") { if (name == "java.lang.Integer" || name == "java.lang.Long") {
jclass nclass = env->FindClass("java/lang/Number"); jclass nclass = env->FindClass("java/lang/Number");
jmethodID intValue = env->GetMethodID(nclass, "intValue", "()I"); jmethodID longValue = env->GetMethodID(nclass, "longValue", "()J");
int ret = env->CallIntMethod(obj, intValue); jlong ret = env->CallLongMethod(obj, longValue);
return ret; return ret;
}; };