[mono-android] Problem with setting of EditText.TextChanged
Jonathan Pryor
jpryor at novell.com
Fri Mar 11 12:59:35 EST 2011
Please file a test case.
Thanks!
- Jon
On Mar 11, 2011, at 10:25 AM, Michal Sartoris wrote:
> Hello,
>
> I’m having problems with adding TextChanged event handler to EditText. It is randomly crashing with this exception:
>
> E/mono (12288): [0xafd4a830:] EXCEPTION handling: System.InvalidCastException
> : Cannot cast from source type to destination type.
> I/MonoDroid(12288): UNHANDLED EXCEPTION: System.InvalidCastException: Cannot cas
> t from source type to destination type.
> I/MonoDroid(12288): at Java.Lang.Throwable.HandleToException (intptr) <0x00070>
> I/MonoDroid(12288): at Android.Runtime.AndroidEnvironment.GetExceptionForLastThr
> owable () <0x0004b>
> I/MonoDroid(12288): at Android.Runtime.JNIEnv.FindClass (string) <0x00057>
> I/MonoDroid(12288): at Android.Runtime.JNIEnv.FindClass (System.Type) <0x0002b>
> I/MonoDroid(12288): at Java.Lang.Object..ctor () <0x0002f>
> I/MonoDroid(12288): at Android.Text.TextWatcherImplementor..ctor (object,System.
> EventHandler`1<Android.Text.TextChangedEventArgs>,System.EventHandler`1<Android.
> Text.TextChangedEventArgs>,System.EventHandler`1<Android.Text.AfterTextChangedEv
> entArgs>) <0x0002b>
> I/MonoDroid(12288): at Android.Widget.TextView.add_TextChanged (System.EventHand
> ler`1<Android.Text.TextChangedEventArgs>) <0x0004b>
>
> My code:
>
> _textField.TextChanged += (s, e) =>
> {
> var fn = FilterChanged;
> if (fn != null)
> {
> fn(this, EventArgs.Empty);
> }
> };
>
> This is working most of the time, but sometimes it crashes. Any suggestions or should I submit a bug report?
>
> Best regards,
>
> Ing. Michal Sartoris
> Resco.net
>
>
>
> __________ Information from ESET NOD32 Antivirus, version of virus signature database 5945 (20110311) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
> _______________________________________________
> Monodroid mailing list
> Monodroid at lists.ximian.com
>
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid
More information about the Monodroid
mailing list