无法检测到该问题。此问题特定于三星设备。
我在日志中得到的另一件事:
"Unexpected null in startExtractingText : mExtractedText = null, input connection = com.android.internal.view.InputConnectionWrapper"
11-23 15:44:06.463 21778-21778/? W/System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.inputmethodservice.InputMethodService.forceExtractEditTextClose()' on a null object reference
11-23 15:44:06.463 21778-21778/? W/System.err: at android.inputmethodservice.ExtractEditText.onScreenStateChanged(ExtractEditText.java:246)
11-23 15:44:06.463 21778-21778/? W/System.err: at android.view.View.dispatchScreenStateChanged(View.java:15375)
11-23 15:44:06.463 21778-21778/? W/System.err: at android.view.ViewGroup.dispatchScreenStateChanged(ViewGroup.java:3164)
11-23 15:44:06.463 21778-21778/? W/System.err: at android.view.ViewGroup.dispatchScreenStateChanged(ViewGroup.java:3164)
11-23 15:44:06.463 21778-21778/? W/System.err: at android.view.ViewGroup.dispatchScreenStateChanged(ViewGroup.java:3164)
11-23 15:44:06.463 21778-21778/? W/System.err: at android.view.ViewGroup.dispatchScreenStateChanged(ViewGroup.java:3164)
11-23 15:44:06.463 21778-21778/? W/System.err: at android.view.ViewGroup.dispatchScreenStateChanged(ViewGroup.java:3164)
11-23 15:44:06.463 21778-21778/? W/System.err: at android.view.ViewGroup.dispatchScreenStateChanged(ViewGroup.java:3164)
11-23 15:44:06.463 21778-21778/? W/System.err: at android.view.ViewGroup.dispatchScreenStateChanged(ViewGroup.java:3164)
11-23 15:44:06.463 21778-21778/? W/System.err: at android.view.ViewGroup.dispatchScreenStateChanged(ViewGroup.java:3164)
11-23 15:44:06.463 21778-21778/? W/System.err: at android.view.ViewRootImpl$1.onDisplayChanged(ViewRootImpl.java:1171)
11-23 15:44:06.463 21778-21778/? W/System.err: at android.hardware.display.DisplayManagerGlobal$DisplayListenerDelegate.handleMessage(DisplayManagerGlobal.java:724)
11-23 15:44:06.463 21778-21778/? W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102)
11-23 15:44:06.463 21778-21778/? W/System.err: at android.os.Looper.loop(Looper.java:158)
11-23 15:44:06.463 21778-21778/? W/System.err: at android.app.ActivityThread.main(ActivityThread.java:7225)
11-23 15:44:06.463 21778-21778/? W/System.err: at java.lang.reflect.Method.invoke(Native Method)
11-23 15:44:06.463 21778-21778/? W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
11-23 15:44:06.463 21778-21778/? W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
我已经通过自己解决了这个问题。就我而言,我在"超级"方法setExtractView(查看视图)上添加了自定义视图。但是我不是先删除观点。
让我解释:
@Override
public void setExtractView(View view) {
// You have to do this if you are not doing so
view.removeAllViews() ; // This is the line
view.addView(yourView) ; // Here you can put your own Custom view
super.setExtractView(view);
}
这对我有用。我希望当您能得到
之类的问题时,这将对您有所帮助"Unexpected null in startExtractingText : mExtractedText = null, input connection = com.android.internal.view.InputConnectionWrapper"