Yes, as the error message tells, it must be derived from Java.Lang.Object.

Atsushi Eno

> Is this because Overlay item is inheriting from System.Object rather
> than Java.Lang.Object?
>
>       public class OverlayItem : Object
>
> On Tue, Dec 6, 2011 at 9:45 AM, Tomasz Cielecki<[email protected]>  wrote:
>> I get the same error even if CreateItem returns OverlayItem. So
>> something is wrong somewhere.
>>
>> On Tue, Dec 6, 2011 at 9:43 AM, Tomasz Cielecki<[email protected]>  
>> wrote:
>>> OK. About that OverlayItem. I have a Custom overlay item which looks like 
>>> this:
>>>
>>>     class NMTOverlayItem : OverlayItem
>>>     {
>>>         private float[] color;
>>>
>>>         public NMTOverlayItem(GeoPoint point, String title, String
>>> snippet, float[] color)
>>>             : base(point, title, snippet)
>>>         {
>>>                     this.color = color;
>>>         }
>>>
>>>         public float[] Color
>>>         {
>>>             get { return color; }
>>>         }
>>>     }
>>>
>>> Now in the itenized overlay I have the CreateItem method:
>>>
>>>         protected override NMTOverlayItem CreateItem(int index)
>>>         {
>>>             return overlayItems.ElementAt(index);
>>>         }
>>>
>>> I get the following error:
>>>
>>> 'NSPublic.AndroidClient.NMTItemizedOverlay.CreateItem(int)': return
>>> type must be 'Java.Lang.Object' to match overridden member
>>> 'Android.GoogleMaps.ItemizedOverlay.CreateItem(int)'
>>>
>>> Any ideas as to why this is happening?
>>>
>>> On Mon, Dec 5, 2011 at 6:52 PM, Tomasz Cielecki<[email protected]>  
>>> wrote:
>>>> Awesome, will give it a go tomorrow :-)
>>>>
>>>> As always good job on the new release!
>>>>
>>>> On Dec 5, 2011 5:38 PM, "Jonathan Pryor"<[email protected]>  wrote:
>>>>> On Dec 5, 2011, at 11:25 AM, Tomasz Cielecki wrote:
>>>>>> Due to changes to how sensors work, i.e. stuff being moved into
>>>>>> SensorTypes the samples on GitHub do not work anymore.
>>>>> Changes needed to get the samples working with the new release were done
>>>>> on the release-2-0 branch, which was just merged to master ~10 minutes 
>>>>> ago.
>>>>> Please update your repo and see if that fixes it. :-)
>>>>>
>>>>>> Also there has been some changes in the ItemizedOverlay now having the
>>>>>> CreateItem method registered, but it needs to return a
>>>>>> Java.Lang.Object, does that mean that my custom OverlayItem has to
>>>>>> inherit from Java.Lang.Object? I thought OverlayItem was already a
>>>>>> Java.Lang.Object?
>>>>> OverlayItem inherits Java.Lang.Object, so your class inheriting from
>>>>> OverlayItem will also inherit Java.Lang.Object, just not directly.
>>>>>
>>>>> Subclassing OverlayItem is fine (and required, iirc).
>>>>>
>>>>>> Is there a list of changes made in the newest release somewhere?
>>>>>
>>>>> http://android.xamarin.com/Releases/Mono_for_Android_4/Release_4.0.0#API_Changes
>>>>>
>>>>>   - Jon
>>>>>
>>>>> _______________________________________________
>>>>> Monodroid mailing list
>>>>> [email protected]
>>>>>
>>>>> UNSUBSCRIBE INFORMATION:
>>>>> http://lists.ximian.com/mailman/listinfo/monodroid
>>>
>>>
>>> --
>>> Med Venlig Hilsen / With Best Regards
>>> Tomasz Cielecki
>>> http://ostebaronen.dk
>>
>>
>> --
>> Med Venlig Hilsen / With Best Regards
>> Tomasz Cielecki
>> http://ostebaronen.dk
>
>

_______________________________________________
Monodroid mailing list
[email protected]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to