[Mono-bugs] [Bug 656553] New: Calling NumberKeyListener.Filter method from derived class crash

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Nov 30 09:32:59 EST 2010


https://bugzilla.novell.com/show_bug.cgi?id=656553

https://bugzilla.novell.com/show_bug.cgi?id=656553#c0


           Summary: Calling NumberKeyListener.Filter method from derived
                    class crash
    Classification: Mono
           Product: MonoDroid
           Version: unspecified
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Class Libraries
        AssignedTo: mkestner at novell.com
        ReportedBy: miso at resco.net
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Created an attachment (id=402695)
 --> (http://bugzilla.novell.com/attachment.cgi?id=402695)
Complete zipped project

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.12)
Gecko/20101026 Firefox/3.6.12

I want to write my own key listener for text view deriving it from
NumberKeyListener. But calling base class Filter method from my class Filter
method is causing a crash: System.Exception: Unexpected char sequence type.
Application crashes only when any character from array returned by
GetAcceptedChars method is pressed. For other characters (which should be
filtered out), application does not crash.

Reproducible: Always

Steps to Reproduce:
1. Build and run attached project.
2. Click on text view.
3. Press any number (0-9) or dot or hyphen.
Actual Results:  
Application crashes with System.Exception: Unexpected char sequence type when
any character from accepted charactes is pressed.

Expected Results:  
Application shouldn't crash and pressed character should be displayed in text
view.

E/mono    (  329): [0xafd48828:] EXCEPTION handling: System.Exception:
Unexpected char sequence type
E/Mono.Android(  329): System.Exception: Unexpected char sequence type
E/Mono.Android(  329):   at Android.Runtime.CharSequence.ToNative
(IEnumerable`1 val) [0x0003a] in
/home/jpobst/Desktop/mondroid/Mono.Android/src/Runtime/CharSequence.cs:41 
E/Mono.Android(  329):   at
Android.Text.Method.NumberKeyListener.n_Filter_Ljava_lang_CharSequence_IILandroid_text_Spanned_II
(IntPtr jnienv, IntPtr native__this, IntPtr native_source, Int32 native_start,
Int32 native_end, IntPtr native_dest, Int32 native_dstart, Int32 native_dend)
[0x00027] in
/home/jpobst/Desktop/mondroid/Mono.Android/src/generated/Android.Text.Method.NumberKeyListener.cs:57 
D/AndroidRuntime(  329): Shutting down VM
W/dalvikvm(  329): threadid=1: thread exiting with uncaught exception
(group=0x4001d800)
E/AndroidRuntime(  329): FATAL EXCEPTION: main
E/AndroidRuntime(  329): java.lang.RuntimeException:
java.lang.reflect.InvocationTargetException
E/AndroidRuntime(  329):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
E/AndroidRuntime(  329):     at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(  329): Caused by: java.lang.reflect.InvocationTargetException
E/AndroidRuntime(  329):     at
android.app.ActivityThread.main(ActivityThread.java:4627)
E/AndroidRuntime(  329):     at java.lang.reflect.Method.invokeNative(Native
Method)
E/AndroidRuntime(  329):     at
java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime(  329):     at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
E/AndroidRuntime(  329):     ... 2 more
E/AndroidRuntime(  329): Caused by: java.lang.Exception: System.Exception:
Unexpected char sequence type
E/AndroidRuntime(  329):   at Android.Runtime.CharSequence.ToNative
(IEnumerable`1 val) [0x0003a] in
/home/jpobst/Desktop/mondroid/Mono.Android/src/Runtime/CharSequence.cs:41 
E/AndroidRuntime(  329):   at
Android.Text.Method.NumberKeyListener.n_Filter_Ljava_lang_CharSequence_IILandroid_text_Spanned_II
(IntPtr jnienv, IntPtr native__this, IntPtr native_source, Int32 native_start,
Int32 native_end, IntPtr native_dest, Int32 native_dstart, Int32 native_dend)
[0x00027] in
/home/jpobst/Desktop/mondroid/Mono.Android/src/generated/Android.Text.Method.NumberKeyListener.cs:57 
E/AndroidRuntime(  329):     at
numericinput.Activity1_NumericKeyListener.n_filter(Native Method)
E/AndroidRuntime(  329):     at
numericinput.Activity1_NumericKeyListener.filter(Activity1_NumericKeyListener.java:43)
E/AndroidRuntime(  329):     at
android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:417)
E/AndroidRuntime(  329):     at
android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:409)
E/AndroidRuntime(  329):     at
android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:28)
E/AndroidRuntime(  329):     at
android.text.method.NumberKeyListener.onKeyDown(NumberKeyListener.java:117)
E/AndroidRuntime(  329):     at
android.widget.TextView.doKeyDown(TextView.java:4304)
E/AndroidRuntime(  329):     at
android.widget.TextView.onKeyDown(TextView.java:4149)
E/AndroidRuntime(  329):     at
android.view.KeyEvent.dispatch(KeyEvent.java:1037)
E/AndroidRuntime(  329):     at
android.view.View.dispatchKeyEvent(View.java:3740)
E/AndroidRuntime(  329):     at
android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:788)
E/AndroidRuntime(  329):     at
android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:788)
E/AndroidRuntime(  329):     at
android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:788)
E/AndroidRuntime(  329):     at
android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:788)
E/AndroidRuntime(  329):     at
com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:1667)
E/AndroidRuntime(  329):     at
com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1102)
E/AndroidRuntime(  329):     at
android.app.Activity.dispatchKeyEvent(Activity.java:2063)
E/AndroidRuntime(  329):     at
com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:1643)
E/AndroidRuntime(  329):     at
android.view.ViewRoot.deliverKeyEventToViewHierarchy(ViewRoot.java:2471)
E/AndroidRuntime(  329):     at
android.view.ViewRoot.handleMessage(ViewRoot.java:1961)
E/AndroidRuntime(  329):     at
android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(  329):     at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime(  329):     ... 6 more

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list