зеркало из https://github.com/mono/mail-archives.git
198 строки
11 KiB
HTML
198 строки
11 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=CACWcBbm%3DS8j2h12ONXr6kzY_8OEG%2BvgP%3D3meEsx90-J_QmMiOA%40mail.gmail.com">
|
|
<META NAME="robots" CONTENT="index,nofollow">
|
|
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
|
<LINK REL="Previous" HREF="007550.html">
|
|
<LINK REL="Next" HREF="007555.html">
|
|
</HEAD>
|
|
<BODY BGCOLOR="#ffffff">
|
|
<H1>[mono-android] New Mono for Android release does not work with some samples on GitHub</H1>
|
|
<B>Atsushi Eno</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=CACWcBbm%3DS8j2h12ONXr6kzY_8OEG%2BvgP%3D3meEsx90-J_QmMiOA%40mail.gmail.com"
|
|
TITLE="[mono-android] New Mono for Android release does not work with some samples on GitHub">atsushieno at veritas-vos-liberabit.com
|
|
</A><BR>
|
|
<I>Tue Dec 6 07:35:12 EST 2011</I>
|
|
<P><UL>
|
|
<LI>Previous message: <A HREF="007550.html">[mono-android] New Mono for Android release does not work with some samples on GitHub
|
|
</A></li>
|
|
<LI>Next message: <A HREF="007555.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#7554">[ date ]</a>
|
|
<a href="thread.html#7554">[ thread ]</a>
|
|
<a href="subject.html#7554">[ subject ]</a>
|
|
<a href="author.html#7554">[ author ]</a>
|
|
</LI>
|
|
</UL>
|
|
<HR>
|
|
<!--beginarticle-->
|
|
<PRE>Ah, no that's not a bug :)
|
|
You likely have "using System;" on top of your source and that binds
|
|
"Object" class to System.Object type. Unlike "java.lang" package for
|
|
Java compilers, C# compiler does not import "Java.Lang" by default, so
|
|
you have to explicitly write "using Java.Lang;" .
|
|
|
|
However, if you do that, C# compiler will error it out because "Object"
|
|
name is now ambiguous between "System.Object" and "Java.Lang.Object".
|
|
So, you will either have to give up using "using" statement or add
|
|
explicit declaration that "using Object = Java.Lang.Object;" .
|
|
|
|
Atsushi Eno
|
|
|
|
><i> So the OverlayItem is having the using Java.Lang; in the top of the
|
|
</I>><i> file and is implementing Object, but then the compiler thinks it is
|
|
</I>><i> System.Object rather than Java.Lang.Object. I guess this is a bug that
|
|
</I>><i> you will have to correct.
|
|
</I>><i>
|
|
</I>><i> Meanwhile I am just using
|
|
</I>><i>
|
|
</I>><i> protected override Java.Lang.Object CreateItem(int index)
|
|
</I>><i> {
|
|
</I>><i> return overlayItems.ElementAt(index);
|
|
</I>><i> }
|
|
</I>><i>
|
|
</I>><i> Which seems to work fine.
|
|
</I>><i>
|
|
</I>><i> I have created a bug report: <A HREF="http://bugzilla.xamarin.com/show_bug.cgi?id=2358">http://bugzilla.xamarin.com/show_bug.cgi?id=2358</A>
|
|
</I>><i>
|
|
</I>><i> On Tue, Dec 6, 2011 at 11:55 AM, Atsushi Eno
|
|
</I>><i> <<A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">atsushieno at veritas-vos-liberabit.com</A>> wrote:
|
|
</I>>><i> Yes, as the error message tells, it must be derived from Java.Lang.Object.
|
|
</I>>><i>
|
|
</I>>><i> Atsushi Eno
|
|
</I>>><i>
|
|
</I>>>><i> Is this because Overlay item is inheriting from System.Object rather
|
|
</I>>>><i> than Java.Lang.Object?
|
|
</I>>>><i>
|
|
</I>>>><i> public class OverlayItem : Object
|
|
</I>>>><i>
|
|
</I>>>><i> On Tue, Dec 6, 2011 at 9:45 AM, Tomasz Cielecki<<A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">tomasz at ostebaronen.dk</A>> wrote:
|
|
</I>>>>><i> I get the same error even if CreateItem returns OverlayItem. So
|
|
</I>>>>><i> something is wrong somewhere.
|
|
</I>>>>><i>
|
|
</I>>>>><i> On Tue, Dec 6, 2011 at 9:43 AM, Tomasz Cielecki<<A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">tomasz at ostebaronen.dk</A>> wrote:
|
|
</I>>>>>><i> OK. About that OverlayItem. I have a Custom overlay item which looks like this:
|
|
</I>>>>>><i>
|
|
</I>>>>>><i> class NMTOverlayItem : OverlayItem
|
|
</I>>>>>><i> {
|
|
</I>>>>>><i> private float[] color;
|
|
</I>>>>>><i>
|
|
</I>>>>>><i> public NMTOverlayItem(GeoPoint point, String title, String
|
|
</I>>>>>><i> snippet, float[] color)
|
|
</I>>>>>><i> : base(point, title, snippet)
|
|
</I>>>>>><i> {
|
|
</I>>>>>><i> this.color = color;
|
|
</I>>>>>><i> }
|
|
</I>>>>>><i>
|
|
</I>>>>>><i> public float[] Color
|
|
</I>>>>>><i> {
|
|
</I>>>>>><i> get { return color; }
|
|
</I>>>>>><i> }
|
|
</I>>>>>><i> }
|
|
</I>>>>>><i>
|
|
</I>>>>>><i> Now in the itenized overlay I have the CreateItem method:
|
|
</I>>>>>><i>
|
|
</I>>>>>><i> protected override NMTOverlayItem CreateItem(int index)
|
|
</I>>>>>><i> {
|
|
</I>>>>>><i> return overlayItems.ElementAt(index);
|
|
</I>>>>>><i> }
|
|
</I>>>>>><i>
|
|
</I>>>>>><i> I get the following error:
|
|
</I>>>>>><i>
|
|
</I>>>>>><i> 'NSPublic.AndroidClient.NMTItemizedOverlay.CreateItem(int)': return
|
|
</I>>>>>><i> type must be 'Java.Lang.Object' to match overridden member
|
|
</I>>>>>><i> 'Android.GoogleMaps.ItemizedOverlay.CreateItem(int)'
|
|
</I>>>>>><i>
|
|
</I>>>>>><i> Any ideas as to why this is happening?
|
|
</I>>>>>><i>
|
|
</I>>>>>><i> On Mon, Dec 5, 2011 at 6:52 PM, Tomasz Cielecki<<A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">tomasz at ostebaronen.dk</A>> wrote:
|
|
</I>>>>>>><i> Awesome, will give it a go tomorrow :-)
|
|
</I>>>>>>><i>
|
|
</I>>>>>>><i> As always good job on the new release!
|
|
</I>>>>>>><i>
|
|
</I>>>>>>><i> On Dec 5, 2011 5:38 PM, "Jonathan Pryor"<<A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">jonp at xamarin.com</A>> wrote:
|
|
</I>>>>>>>><i> On Dec 5, 2011, at 11:25 AM, Tomasz Cielecki wrote:
|
|
</I>>>>>>>>><i> Due to changes to how sensors work, i.e. stuff being moved into
|
|
</I>>>>>>>>><i> SensorTypes the samples on GitHub do not work anymore.
|
|
</I>>>>>>>><i> Changes needed to get the samples working with the new release were done
|
|
</I>>>>>>>><i> on the release-2-0 branch, which was just merged to master ~10 minutes ago.
|
|
</I>>>>>>>><i> Please update your repo and see if that fixes it. :-)
|
|
</I>>>>>>>><i>
|
|
</I>>>>>>>>><i> Also there has been some changes in the ItemizedOverlay now having the
|
|
</I>>>>>>>>><i> CreateItem method registered, but it needs to return a
|
|
</I>>>>>>>>><i> Java.Lang.Object, does that mean that my custom OverlayItem has to
|
|
</I>>>>>>>>><i> inherit from Java.Lang.Object? I thought OverlayItem was already a
|
|
</I>>>>>>>>><i> Java.Lang.Object?
|
|
</I>>>>>>>><i> OverlayItem inherits Java.Lang.Object, so your class inheriting from
|
|
</I>>>>>>>><i> OverlayItem will also inherit Java.Lang.Object, just not directly.
|
|
</I>>>>>>>><i>
|
|
</I>>>>>>>><i> Subclassing OverlayItem is fine (and required, iirc).
|
|
</I>>>>>>>><i>
|
|
</I>>>>>>>>><i> Is there a list of changes made in the newest release somewhere?
|
|
</I>>>>>>>><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>>>>>>>><i>
|
|
</I>>>>>>>><i> - Jon
|
|
</I>>>>>>>><i>
|
|
</I>>>>>>>><i> _______________________________________________
|
|
</I>>>>>>>><i> Monodroid mailing list
|
|
</I>>>>>>>><i> <A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">Monodroid at lists.ximian.com</A>
|
|
</I>>>>>>>><i>
|
|
</I>>>>>>>><i> UNSUBSCRIBE INFORMATION:
|
|
</I>>>>>>>><i> <A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">http://lists.ximian.com/mailman/listinfo/monodroid</A>
|
|
</I>>>>>><i>
|
|
</I>>>>>><i> --
|
|
</I>>>>>><i> Med Venlig Hilsen / With Best Regards
|
|
</I>>>>>><i> Tomasz Cielecki
|
|
</I>>>>>><i> <A HREF="http://ostebaronen.dk">http://ostebaronen.dk</A>
|
|
</I>>>>><i>
|
|
</I>>>>><i> --
|
|
</I>>>>><i> Med Venlig Hilsen / With Best Regards
|
|
</I>>>>><i> Tomasz Cielecki
|
|
</I>>>>><i> <A HREF="http://ostebaronen.dk">http://ostebaronen.dk</A>
|
|
</I>>>><i>
|
|
</I>>><i> _______________________________________________
|
|
</I>>><i> Monodroid mailing list
|
|
</I>>><i> <A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">Monodroid at lists.ximian.com</A>
|
|
</I>>><i>
|
|
</I>>><i> UNSUBSCRIBE INFORMATION:
|
|
</I>>><i> <A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">http://lists.ximian.com/mailman/listinfo/monodroid</A>
|
|
</I>><i>
|
|
</I>><i>
|
|
</I>
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--endarticle-->
|
|
<HR>
|
|
<P><UL>
|
|
<!--threads-->
|
|
<LI>Previous message: <A HREF="007550.html">[mono-android] New Mono for Android release does not work with some samples on GitHub
|
|
</A></li>
|
|
<LI>Next message: <A HREF="007555.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#7554">[ date ]</a>
|
|
<a href="thread.html#7554">[ thread ]</a>
|
|
<a href="subject.html#7554">[ subject ]</a>
|
|
<a href="author.html#7554">[ 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>
|