From 61cfcdb33b75a9e3d0581edf1bd3adee82b78adf Mon Sep 17 00:00:00 2001 From: Nicholas Hallahan Date: Thu, 16 Jul 2015 07:50:30 -0700 Subject: [PATCH] turning list into array #1716 --- android/cpp/jni.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/android/cpp/jni.cpp b/android/cpp/jni.cpp index bb815fefd..0b5344178 100644 --- a/android/cpp/jni.cpp +++ b/android/cpp/jni.cpp @@ -511,6 +511,19 @@ jlong JNICALL nativeAddPolyline(JNIEnv *env, jobject obj, jlong nativeMapViewPtr return -1; } + jobjectArray array = + reinterpret_cast(env->CallObjectMethod(points, listToArrayId)); + if (env->ExceptionCheck() || (array == nullptr)) { + env->ExceptionDescribe(); + return -1; + } + + jsize len = env->GetArrayLength(array); + if (len < 0) { + env->ExceptionDescribe(); + return -1; + } + return (jlong)width; }