I have solved this issue myself... Its all because of the "extarcted
view" (or) "fullscreenmode" view being enabled by default in my IME.
Though its strange that it crashes only in 2.3.3 and not in 2.3.1
platform. Overriding onEvaluateFullScreenMode() of inputmethod and
always returning false(ie. never show my SIP in FullScreenMode) fixes
the crash.

But I believe that it will be better if a platform side fix is also
made after investigating this issue. My application currently targets
only tablets and removing fullscreen option shudn't be a big problem
in terms of text input on editors, where as for mobile phones some
IMEs might prefer to show their SIP in fullscreen mode(especially in
landscape orientation) on editors for facilitating the users to type &
view their content and this crash issue will be a big problem for
them.

On Sep 19, 7:33 pm, Mudhalvan <prasankuma...@gmail.com> wrote:
> Hi,
>
> Currently I'm encountering a weird issue in which myIMEprocess is
> getting crashed even though its not the defaultIME. The following
> thread which was posted earlier nearly talks about the same issue.
>
> http://groups.google.com/group/android-developers/browse_thread/threa...
>
> I'm assuming that its not the issue with myIMEalone as the above
> thread speaks aboutLatinIME. Following are the steps to reproduce
> the issue:
>
> 1) After installing yourIME, make it the default one such that your
> SIP appears on the editor( say for example GMail ) application. close
> this editor and open another editor.
>
> 2) After typing some words, keep the cursor in between a word and long
> press on the editor to bring up the options with "Add word to
> dictionary". Select that option, which will open the Add word editor
> separately.
>
> 3) There again type (or) add some words from candidate bar and then
> switch theIMEfrom yours to "Android default"IME. After the
> switching is done, tap on the "back" key twice.
>
> 4) On the second tapping of back key, the "Null Pointer 
> Exception"crashappears on the screen with myIME'sprocess mentioned(not the
> Android default one).
>
> Here is the exact piece ofcrashlog which I took out the device( I'm
> actually using a tablet which is running on 2.3.3 ).
>
> 09-15 14:23:11.720: WARN/InputManagerService(113): Window already
> focused, ignoring focus gain of:
> com.android.internal.view.IInputMethodClient$Stub$Proxy@40864a00
> 09-15 14:23:17.190: DEBUG/AndroidRuntime(24837): Shutting down VM
> 09-15 14:23:17.190: WARN/dalvikvm(24837): threadid=1: thread exiting
> with uncaught exception (group=0x40150560)
> 09-15 14:23:17.190: ERROR/AndroidRuntime(24837): FATAL EXCEPTION: main
> 09-15 14:23:17.190: ERROR/AndroidRuntime(24837):
> java.lang.NullPointerException
> 09-15 14:23:17.190: ERROR/AndroidRuntime(24837):     at
> android.inputmethodservice.IInputMethodSessionWrapper.executeMessage(IInputMethodSessionWrapper.java:
> 88)
> 09-15 14:23:17.190: ERROR/AndroidRuntime(24837):     at
> com.android.internal.os.HandlerCaller
> $MyHandler.handleMessage(HandlerCaller.java:61)
> 09-15 14:23:17.190: ERROR/AndroidRuntime(24837):     at
> android.os.Handler.dispatchMessage(Handler.java:99)
> 09-15 14:23:17.190: ERROR/AndroidRuntime(24837):     at
> android.os.Looper.loop(Looper.java:123)
> 09-15 14:23:17.190: ERROR/AndroidRuntime(24837):     at
> android.app.ActivityThread.main(ActivityThread.java:3683)
> 09-15 14:23:17.190: ERROR/AndroidRuntime(24837):     at
> java.lang.reflect.Method.invokeNative(Native Method)
> 09-15 14:23:17.190: ERROR/AndroidRuntime(24837):     at
> java.lang.reflect.Method.invoke(Method.java:507)
> 09-15 14:23:17.190: ERROR/AndroidRuntime(24837):     at
> com.android.internal.os.ZygoteInit
> $MethodAndArgsCaller.run(ZygoteInit.java:839)
> 09-15 14:23:17.190: ERROR/AndroidRuntime(24837):     at
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
> 09-15 14:23:17.190: ERROR/AndroidRuntime(24837):     at
> dalvik.system.NativeStart.main(Native Method)
>
> I browsed the net and found from sources that the
> InputMethodSessionWrapper in its handler is still trying to use the
> old(invalid) InputMethodSession and calls UpdateExtractedText() with
> out a "null" check. My question is after theIMEis swicthed from mine
> to Android default one, why the InputMethodSessionWrapper is still
> trying to use the old inputmethodsession object ?
> Am I missing something from my onDestroy() call which is causing this
> issue ?(I double checked and found that all required resources like
> registered receivers are unregistered & things like that. Moreover if
> I swap the positions of IMEs and follow above same steps, Android
> defaultIMEis not crashing) (or) am I missing any vital interface
> methods from being overridden in myIME?( I even tried keeping dummy
> implementation of onbindInput() and onUnbindInput() and called the
> super class method, without success in this regard) (or)  is this a
> issue which needs to be addressed from the platform end ?
>
> Thanks,

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to