mail-archives/monodroid/2011-December/007543.html

169 строки
8.2 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [mono-android] New Mono for Android release does not work with some samples on GitHub
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:monodroid%40lists.ximian.com?Subject=%5Bmono-android%5D%20New%20Mono%20for%20Android%20release%20does%20not%20work%20with%0A%20some%20samples%20on%20GitHub&In-Reply-To=CACWcBbk%2BKtJ9om5Mu%3DpSyX_8FyRho-X2yOrPFPch1R9LsLexAg%40mail.gmail.com">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="007542.html">
<LINK REL="Next" HREF="007546.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[mono-android] New Mono for Android release does not work with some samples on GitHub</H1>
<B>Tomasz Cielecki</B>
<A HREF="mailto:monodroid%40lists.ximian.com?Subject=%5Bmono-android%5D%20New%20Mono%20for%20Android%20release%20does%20not%20work%20with%0A%20some%20samples%20on%20GitHub&In-Reply-To=CACWcBbk%2BKtJ9om5Mu%3DpSyX_8FyRho-X2yOrPFPch1R9LsLexAg%40mail.gmail.com"
TITLE="[mono-android] New Mono for Android release does not work with some samples on GitHub">tomasz at ostebaronen.dk
</A><BR>
<I>Tue Dec 6 03:55:38 EST 2011</I>
<P><UL>
<LI>Previous message: <A HREF="007542.html">[mono-android] New Mono for Android release does not work with some samples on GitHub
</A></li>
<LI>Next message: <A HREF="007546.html">[mono-android] New Mono for Android release does not work with some samples on GitHub
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#7543">[ date ]</a>
<a href="thread.html#7543">[ thread ]</a>
<a href="subject.html#7543">[ subject ]</a>
<a href="author.html#7543">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>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 &lt;<A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">tomasz at ostebaronen.dk</A>&gt; wrote:
&gt;<i> I get the same error even if CreateItem returns OverlayItem. So
</I>&gt;<i> something is wrong somewhere.
</I>&gt;<i>
</I>&gt;<i> On Tue, Dec 6, 2011 at 9:43 AM, Tomasz Cielecki &lt;<A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">tomasz at ostebaronen.dk</A>&gt; wrote:
</I>&gt;&gt;<i> OK. About that OverlayItem. I have a Custom overlay item which looks like this:
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> &#160; &#160;class NMTOverlayItem : OverlayItem
</I>&gt;&gt;<i> &#160; &#160;{
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160;private float[] color;
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160;public NMTOverlayItem(GeoPoint point, String title, String
</I>&gt;&gt;<i> snippet, float[] color)
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160; &#160; &#160;: base(point, title, snippet)
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160;{
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;this.color = color;
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160;}
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160;public float[] Color
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160;{
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160; &#160; &#160;get { return color; }
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160;}
</I>&gt;&gt;<i> &#160; &#160;}
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> Now in the itenized overlay I have the CreateItem method:
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160;protected override NMTOverlayItem CreateItem(int index)
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160;{
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160; &#160; &#160;return overlayItems.ElementAt(index);
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160;}
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> I get the following error:
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> 'NSPublic.AndroidClient.NMTItemizedOverlay.CreateItem(int)': return
</I>&gt;&gt;<i> type must be 'Java.Lang.Object' to match overridden member
</I>&gt;&gt;<i> 'Android.GoogleMaps.ItemizedOverlay.CreateItem(int)'
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> Any ideas as to why this is happening?
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> On Mon, Dec 5, 2011 at 6:52 PM, Tomasz Cielecki &lt;<A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">tomasz at ostebaronen.dk</A>&gt; wrote:
</I>&gt;&gt;&gt;<i> Awesome, will give it a go tomorrow :-)
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> As always good job on the new release!
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> On Dec 5, 2011 5:38 PM, &quot;Jonathan Pryor&quot; &lt;<A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">jonp at xamarin.com</A>&gt; wrote:
</I>&gt;&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;&gt;<i> On Dec 5, 2011, at 11:25 AM, Tomasz Cielecki wrote:
</I>&gt;&gt;&gt;&gt;<i> &gt; Due to changes to how sensors work, i.e. stuff being moved into
</I>&gt;&gt;&gt;&gt;<i> &gt; SensorTypes the samples on GitHub do not work anymore.
</I>&gt;&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;&gt;<i> Changes needed to get the samples working with the new release were done
</I>&gt;&gt;&gt;&gt;<i> on the release-2-0 branch, which was just merged to master ~10 minutes ago.
</I>&gt;&gt;&gt;&gt;<i> Please update your repo and see if that fixes it. :-)
</I>&gt;&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;&gt;<i> &gt; Also there has been some changes in the ItemizedOverlay now having the
</I>&gt;&gt;&gt;&gt;<i> &gt; CreateItem method registered, but it needs to return a
</I>&gt;&gt;&gt;&gt;<i> &gt; Java.Lang.Object, does that mean that my custom OverlayItem has to
</I>&gt;&gt;&gt;&gt;<i> &gt; inherit from Java.Lang.Object? I thought OverlayItem was already a
</I>&gt;&gt;&gt;&gt;<i> &gt; Java.Lang.Object?
</I>&gt;&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;&gt;<i> OverlayItem inherits Java.Lang.Object, so your class inheriting from
</I>&gt;&gt;&gt;&gt;<i> OverlayItem will also inherit Java.Lang.Object, just not directly.
</I>&gt;&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;&gt;<i> Subclassing OverlayItem is fine (and required, iirc).
</I>&gt;&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;&gt;<i> &gt; Is there a list of changes made in the newest release somewhere?
</I>&gt;&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;&gt;<i> <A HREF="http://android.xamarin.com/Releases/Mono_for_Android_4/Release_4.0.0#API_Changes">http://android.xamarin.com/Releases/Mono_for_Android_4/Release_4.0.0#API_Changes</A>
</I>&gt;&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;&gt;<i> &#160;- Jon
</I>&gt;&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;&gt;<i> _______________________________________________
</I>&gt;&gt;&gt;&gt;<i> Monodroid mailing list
</I>&gt;&gt;&gt;&gt;<i> <A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">Monodroid at lists.ximian.com</A>
</I>&gt;&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;&gt;<i> UNSUBSCRIBE INFORMATION:
</I>&gt;&gt;&gt;&gt;<i> <A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">http://lists.ximian.com/mailman/listinfo/monodroid</A>
</I>&gt;&gt;<i>
</I>&gt;&gt;<i>
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> --
</I>&gt;&gt;<i> Med Venlig Hilsen / With Best Regards
</I>&gt;&gt;<i> Tomasz Cielecki
</I>&gt;&gt;<i> <A HREF="http://ostebaronen.dk">http://ostebaronen.dk</A>
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> --
</I>&gt;<i> Med Venlig Hilsen / With Best Regards
</I>&gt;<i> Tomasz Cielecki
</I>&gt;<i> <A HREF="http://ostebaronen.dk">http://ostebaronen.dk</A>
</I>
--
Med Venlig Hilsen / With Best Regards
Tomasz Cielecki
<A HREF="http://ostebaronen.dk">http://ostebaronen.dk</A>
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="007542.html">[mono-android] New Mono for Android release does not work with some samples on GitHub
</A></li>
<LI>Next message: <A HREF="007546.html">[mono-android] New Mono for Android release does not work with some samples on GitHub
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#7543">[ date ]</a>
<a href="thread.html#7543">[ thread ]</a>
<a href="subject.html#7543">[ subject ]</a>
<a href="author.html#7543">[ author ]</a>
</LI>
</UL>
<hr>
<a href="http://lists.ximian.com/mailman/listinfo/monodroid">More information about the Monodroid
mailing list</a><br>
</body></html>