Skip to content

Commit

Permalink
Merge pull request #23851 from SimonSikstrom/android-long-calldeferre…
Browse files Browse the repository at this point in the history
…d-issue23845

Support for java.lang.Long values in Android GodotLib.calldeferred calls
  • Loading branch information
akien-mga authored Nov 20, 2018
2 parents 7439e55 + 00b57d3 commit f2cc969
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions platform/android/java_glue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,11 +268,11 @@ Variant _jobject_to_variant(JNIEnv *env, jobject obj) {
return ret;
};

if (name == "java.lang.Integer") {
if (name == "java.lang.Integer" || name == "java.lang.Long") {

jclass nclass = env->FindClass("java/lang/Number");
jmethodID intValue = env->GetMethodID(nclass, "intValue", "()I");
int ret = env->CallIntMethod(obj, intValue);
jmethodID longValue = env->GetMethodID(nclass, "longValue", "()J");
jlong ret = env->CallLongMethod(obj, longValue);
return ret;
};

Expand Down

0 comments on commit f2cc969

Please sign in to comment.