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

126 строки
4.6 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [mono-android] Java.Lang.NoClassDefFoundError: java.lang.ICharSequence
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:monodroid%40lists.ximian.com?Subject=%5Bmono-android%5D%0A%09Java.Lang.NoClassDefFoundError%3A%09java.lang.ICharSequence&In-Reply-To=A7962E33-A0B5-4CEB-805B-1EB3BF2E2408%40xamarin.com">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="007594.html">
<LINK REL="Next" HREF="007598.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[mono-android] Java.Lang.NoClassDefFoundError: java.lang.ICharSequence</H1>
<B>Andrew Sinclair</B>
<A HREF="mailto:monodroid%40lists.ximian.com?Subject=%5Bmono-android%5D%0A%09Java.Lang.NoClassDefFoundError%3A%09java.lang.ICharSequence&In-Reply-To=A7962E33-A0B5-4CEB-805B-1EB3BF2E2408%40xamarin.com"
TITLE="[mono-android] Java.Lang.NoClassDefFoundError: java.lang.ICharSequence">andrew at magic5software.com
</A><BR>
<I>Tue Dec 6 11:53:54 EST 2011</I>
<P><UL>
<LI>Previous message: <A HREF="007594.html">[mono-android] Java.Lang.NoClassDefFoundError: java.lang.ICharSequence
</A></li>
<LI>Next message: <A HREF="007598.html">[mono-android] Java.Lang.NoClassDefFoundError: java.lang.ICharSequence
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#7596">[ date ]</a>
<a href="thread.html#7596">[ thread ]</a>
<a href="subject.html#7596">[ subject ]</a>
<a href="author.html#7596">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>Jon,
That workaround works fine for me (IInputFilter) but if the RegisterType
runs twice I get:
System.ArgumentException: An element with the same key already exists in the
dictionary.
at System.Collections.Generic.Dictionary`2&lt;string, System.Type&gt;.Add
(string,System.Type) &lt;0x00328&gt;
at Android.Runtime.TypeManager.RegisterType (string,System.Type) &lt;0x00073&gt;
Is there a way of checking for existing registrations?
Thanks,
Andy
-----Original Message-----
From: <A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">monodroid-bounces at lists.ximian.com</A>
[mailto:<A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">monodroid-bounces at lists.ximian.com</A>] On Behalf Of Jonathan Pryor
Sent: 06 December 2011 16:48
To: Discussions related to Mono for Android
Subject: Re: [mono-android] Java.Lang.NoClassDefFoundError:
java.lang.ICharSequence
On Dec 6, 2011, at 8:13 AM, Tossing, Chris wrote:
&gt;<i> I am able to launch and run our application, but I am getting a
</I>Java.Lang.NoClassDefFoundError exception when trying set the items of an
AlertDialog using AlertDialog.Builder.SetItems(..).
&gt;<i>
</I>&gt;<i> Here is our code:
</I>&gt;<i> var builder = this.CreateDialog(title, null)
</I>&gt;<i> .SetItems(items, (s, e) =&gt; {
</I>CallResultHandler(resultHandler, (int)e.Which); })
&gt;<i> .SetNeutralButton(defaultText ?? &quot;Cancel&quot;, (s, e) =&gt; {
</I>CallResultHandler(resultHandler, null); });
That's a new one (I usually see that with IInputFilter). This should should
be fixed in the next release. In the meantime, you should be able to fix
this by placing the following statement prior to the above statement:
Android.Runtime.TypeManager.RegisterType (&quot;java/langCharSequence&quot;,
typeof (Java.Lang.ICharSequence));
Thanks,
- Jon
_______________________________________________
Monodroid mailing list
<A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">Monodroid at lists.ximian.com</A>
UNSUBSCRIBE INFORMATION:
<A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">http://lists.ximian.com/mailman/listinfo/monodroid</A>
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="007594.html">[mono-android] Java.Lang.NoClassDefFoundError: java.lang.ICharSequence
</A></li>
<LI>Next message: <A HREF="007598.html">[mono-android] Java.Lang.NoClassDefFoundError: java.lang.ICharSequence
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#7596">[ date ]</a>
<a href="thread.html#7596">[ thread ]</a>
<a href="subject.html#7596">[ subject ]</a>
<a href="author.html#7596">[ 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>