Binding .jar type problem

GiuseppeFalaGiuseppeFala ITMember
edited July 2016 in Xamarin.Android

Hi,
I have a library .jar with the following function:

public void doAction(ArrayList<String[][]> list, int[] time) { }

I have create a binding project and the api.xml has this code:

<method abstract="false" deprecated="not deprecated" final="false" name="doAction" native="false" return="void" static="false" synchronized="false" visibility="public"> <parameter name="p0" type="java.util.ArrayList<java.lang.String[][]>"> </parameter> <parameter name="p1" type="int[]"> </parameter> </method>

I have added the reference of the binding dll in my android project and exploring dll i see:

    using Android.Runtime;
    using System;
    using System.Collections.Generic;

    [Register ("doAction", "(Ljava/util/ArrayList;[I)V", "GetDoAction_Ljava_util_ArrayList_arrayIHandler")]
    public virtual void DoAction (IList<string[][]> p0, int[] p1);

The usage is:

    var myList = new List<string [] []> ();
    var myCmd = new string [5] [];
    int [] exeTime = new int [100];

    myCmd = new string [5] [];
    myCmd [0] = new string [] { "F", "2" };
    myCmd [1] = new string [] { "A", "2" };
    myCmd [2] = new string [] { "P", "0" };
    myCmd [3] = new string [] { "V", "5" };
    myCmd [4] = new string [] { "E", "1" };

    myList.Add (myCmd);
    exeTime [0] = 10;

    mLib.DoAction (myList, exeTime);

So there is the following error :
mono.android.runtime.JavaObject cannot be cast to java.lang.String[][]

What is wrong?

Thanks

Sign In or Register to comment.