当我长按我的自定义网页浏览时,会显示以下错误: -
java.lang.NullPointerException
at android.webkit.WebViewClassic.showSelectActionWindow(WebViewClassic.java:1974)
at android.webkit.WebViewClassic.access$8100(WebViewClassic.java:279)
at android.webkit.WebViewClassic$PrivateHandler.handleMessage(WebViewClassic.java:12888)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:5419)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)
at dalvik.system.NativeStart.main(Native Method)
启动操作模式时出错: public ActionMode startActionMode(ActionMode.Callback callback){
Log.d("dic","STARTING ACTION MODE");
if(callback == null){
Log.d("longpress","callback is null");
return null;
}
/*
* Related to XC-929
* if the new UI proposal is approved use this
* Aug 29
*
**/
if(callback.equals(mActionModeCallback)){
Log.d("longpress","callback is equal");
selectedText=getSelectedText();
if(mActionMode == null){
mActionMode = super.startActionMode(callback);
}
return mActionMode;
}
if(isTablet){
Log.d("longpress","callback is different");
if(mActionMode == null){
mActionMode = startActionMode(mActionModeCallback);
}
return mActionMode;
}
else {
mActionMode = null;
return null;
}
}
,错误是: -
STACK_TRACE=java.lang.NullPointerException
at android.webkit.WebViewClassic.showSelectActionWindow(WebViewClassic.java:1974)
at android.webkit.WebViewClassic.access$8100(WebViewClassic.java:279)
at android.webkit.WebViewClassic$PrivateHandler.handleMessage(WebViewClassic.java:12888)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:5419)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)
at dalvik.system.NativeStart.main(Native Method)
我在网上搜索没有关于webviewClassic的内容。它仅在三星s3 4.3和所有其他设备上显示此错误,相同的代码工作正常。 请建议我任何解决方案的线索。 感谢