处理数组类型

This commit is contained in:
范大德 2023-10-12 23:26:03 +08:00
parent 81891e97c9
commit eba70ffe77

View File

@ -110,7 +110,7 @@ public class JcPrinter extends CordovaPlugin {
obj = methodJsonArgs.opt(i);
}
if(obj instanceof JSONArray){
Object array = Array.newInstance(a,((JSONArray) obj).length());
Object array = Array.newInstance(a.getComponentType(),((JSONArray) obj).length());
for(int j=0;j<((JSONArray) obj).length();j++){
Array.set(array,j,((JSONArray) obj).opt(j));
}