[Monodroid] Change in preview 13 related to EditText.Text
Paul Camacho
paul.camacho at gmx.de
Wed Mar 2 06:25:46 EST 2011
I think you should be setting it to the empty string "" instead of null, and wait for the garbage collector to come clean up. I don't think it's a bug.
Am 02.03.2011 um 12:03 schrieb Orlando Silva <orlandolsilva at gmail.com>:
> The EditText controller is also crashing when we set the Text's property to null.
>
> Best Regards,
> Orlando
>
>
> On Wed, Mar 2, 2011 at 10:56 AM, Orlando Silva <orlandolsilva at gmail.com> wrote:
> Hi,
>
> I see, thanks for your help, ya that works :)
> I thought that wouldn't work because my code was crashing when i set this.TextView.Text = null, this is a new bug? should i report it?
>
> Error log:
> gids={3003, 1015}
> E/mono ( 7005): [0xafd4d440:] EXCEPTION handling: Java.Lang.NullPointerException: Exception of type 'Java.Lang.NullPo
> interException' was thrown.
> I/MonoDroid( 7005): UNHANDLED EXCEPTION: Java.Lang.NullPointerException: Exception of type 'Java.Lang.NullPointerExcepti
> on' was thrown.
> I/MonoDroid( 7005): at Android.Runtime.JNIEnv.NewObject (intptr,intptr,Android.Runtime.JValue[]) <0x000a4>
> I/MonoDroid( 7005): at Java.Lang.String..ctor (string) <0x0025f>
> I/MonoDroid( 7005): at Android.Widget.TextView.set_Text (string) <0x0002b>
> I/MonoDroid( 7005): at MonoDroidApplicationTextViewP13.Activity1.OnCreate (Android.OS.Bundle) <0x00193>
> I/MonoDroid( 7005): at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (intptr,intptr,intptr) <0x0005f>
> I/MonoDroid( 7005): at (wrapper dynamic-method) object.6c30b5a4-906e-4c06-add1-b2af5c1e5416 (intptr,intptr,intptr) <0x00
> 033>
> E/mono ( 7005): [0xafd4d440:] EXCEPTION handling: Java.Lang.NullPointerException: Exception of type 'Java.Lang.NullPo
> interException' was thrown.
> E/mono ( 7005):
> E/mono ( 7005): Unhandled Exception: Java.Lang.NullPointerException: Exception of type 'Java.Lang.NullPointerExceptio
> n' was thrown.
> E/mono ( 7005): at Android.Runtime.JNIEnv.NewObject (IntPtr jclass, IntPtr jmethod, Android.Runtime.JValue[] parms)
> [0x00000] in <filename unknown>:0
> E/mono ( 7005): at Java.Lang.String..ctor (System.String string) [0x00000] in <filename unknown>:0
> E/mono ( 7005): at Android.Widget.TextView.set_Text (System.String value) [0x00000] in <filename unknown>:0
> E/mono ( 7005): at MonoDroidApplicationTextViewP13.Activity1.OnCreate (Android.OS.Bundle bundle) [0x00000] in <file
>
>
> Thanks for you help,
> Orlando
>
>
> On Wed, Mar 2, 2011 at 10:37 AM, Torello Querci <tquerci at gmail.com> wrote:
> 2011/3/2 Orlando Silva <orlandolsilva at gmail.com>:
> > Hello,
> > Now in P13, when i try to do:
> > "
> > string text = "new string";
> > this.TextView.TextFormatted = text;
> > "
> > I get the compile error "Cannot implicitly convert type 'string' to
> > 'Java.Lang.ICharSequence' "? Now, how can i set an string value to the
> > TextView's controller?
> > Thanks for all your help,
> > Orlando
> >
>
> If you want to use e TextFormatted you need pass a IChar sequence.
>
> For example in my code I pass a Android.Text.Html.FromHtml object to a
> TextFormatted.
>
> In other part of my code I need to change from
>
> menu.SetHeaderTitle(server.Name);
>
> to
>
> Java.Lang.ICharSequence str = new Java.Lang.String(server.Name);
> menu.SetHeaderTitle(str);
>
> As write from Dan Kibby this is intentional and write in the release notes
>
> Best Regards, Torello
>
> >
> > On Fri, Feb 25, 2011 at 11:28 PM, Dan Kibby <DKIBBY at motorstate.com> wrote:
> >>
> >> Intentional...release notes clarify
> >>
> >>
> >> Chris Erickson <chris at cartopac.com> wrote:
> >>
> >> Hello,
> >> In preview 13, I had something break where I was setting an EditText.Text
> >> property to null and I'm now getting a null reference exception…
> >>
> >> Was this change intentional or is this a defect?
> >>
> >> chris erickson
> >> chris at cartopac.com
> >> _______________________________________________
> >> Monodroid mailing list
> >> Monodroid at lists.ximian.com
> >>
> >> UNSUBSCRIBE INFORMATION:
> >> http://lists.ximian.com/mailman/listinfo/monodroid
> >
> >
> > _______________________________________________
> > Monodroid mailing list
> > Monodroid at lists.ximian.com
> >
> > UNSUBSCRIBE INFORMATION:
> > http://lists.ximian.com/mailman/listinfo/monodroid
> >
> >
>
>
> _______________________________________________
> Monodroid mailing list
> Monodroid at lists.ximian.com
>
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/mailman/private/monodroid/attachments/20110302/99eac541/attachment.html
More information about the Monodroid
mailing list