I get a NullPointerException on the SuggestionSpan site. (A stack trace is included below). Since the stack trace does not include any of my code, I absolutely do not know where to start debugging.
An error can be reproduced whenever I press the spacebar (or select a word) when using EditText. I tried several keyboards, including Android Android, but the same error appears.
FATAL EXCEPTION: main java.lang.NullPointerException at android.text.style.SuggestionSpan.<init>(SuggestionSpan.java:128) at android.text.style.SuggestionSpan.<init>(SuggestionSpan.java:101) at android.widget.SpellChecker.createMisspelledSuggestionSpan(SpellChecker.java:392) at android.widget.SpellChecker.onGetSuggestions(SpellChecker.java:300) at android.view.textservice.SpellCheckerSession.handleOnGetSuggestionsMultiple(SpellCheckerSession.java:198) at android.view.textservice.SpellCheckerSession.access$000(SpellCheckerSession.java:86) at android.view.textservice.SpellCheckerSession$1.handleMessage(SpellCheckerSession.java:112) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4424) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) at dalvik.system.NativeStart.main(Native Method)
EDIT: I can only reproduce the error on my Nexus S with 4.0.3, but not on emulators with other OS versions. Weird
EDIT 2: A strange thing! I just dragged EditText into another action, and the same thing happens. Not a single code is attached to it, nor any XML changes made to it.
android
Maurice Lam
source share