InputConnection.finishComposedText()方法中的空指针异常 [英] Null Pointer Exception in InputConnection.finishComposingText() method

查看:96
本文介绍了InputConnection.finishComposedText()方法中的空指针异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在inputmethod.InputConnection.finishComposedText()中得到了NPE,日志消息如下:

I am getting a NPE in inputmethod.InputConnection.finishComposingText(), The Log message is as follows:

java.lang.NullPointerException: Attempt to invoke interface method 'boolean android.view.inputmethod.InputConnection.finishComposingText()' on a null object reference
        at android.view.inputmethod.InputConnectionWrapper.finishComposingText(InputConnectionWrapper.java:78)
        at com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:362)
        at com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:78)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:135)
        at android.app.ActivityThread.main(ActivityThread.java:5289)
        at java.lang.reflect.Method.invoke(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:372)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)

我在Android 5中正面临着它,但在Android中运行良好.

I am facing it in Android 5 but works fine in Android .

该错误未在我的代码中指定任何代码行,而只是告诉了库中的某些代码行.

The error is not specifying any line of code from my code just telling some code lines from library.

每当我按下后退"按钮从一项活动转到主要活动时,我都会面对它.是的,其他活动也包含EditText.

I am facing it whenever I press back button to move from one activity to main activity. And yes also other activity contains EditText.

我删除了softKeyboard的所有实例,我认为是由于这个原因

I removed all the instances of softKeyboard, I thought it was due to that

如果有人可以提前帮助我,那就太好了

It will be great if someone can help me thanks in advance

推荐答案

转到编辑配置设置->分析->启用高级分析这样可以防止 EditText 崩溃.

Go to Edit configuration settings -> Profiling -> Enable advanced profiling this will prevent EditText from crashing.

这篇关于InputConnection.finishComposedText()方法中的空指针异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆