Forum Xamarin.Android

How to convert C# List to Java IIterable

I have some LatLng point in a c# list. I want to use below code:

PolygonOptions  rectOptions = new PolygonOptions();
            rectOptions.AddAll   (val);

but because AddAll() method get IIterable method I can not use it.

Actually I want to use AddAll because in the topic I link below, the writer of the accepted answer used this method. I'm not aware of what is diffrence between Add() method and AddAll() method but when I use Add() method my result is not same with what you see in the image of link. So I tried to use AddAll() method that faced with this error.

http://stackoverflow.com/questions/20901141/how-to-draw-free-hand-polygon-in-google-map-v2-in-android/20916931#20916931

Posts

  • JPMcWhiskersJPMcWhiskers USMember ✭✭

    This is old, but if anyone is working with Maps and needs to add an IIterable array for using AddHole(IIterable), you can do this:

    Java.Util.ArrayList al = new Java.Util.ArrayList(--A C# array--);
    PolygonOptions.AddHole(al);

Sign In or Register to comment.