我正在使用 webview 在 android 上加载数据。它加载得很好,但是当我触摸 webview 时,它会使应用程序崩溃并显示以下错误消息。我在 android 4.2 中遇到了这个问题,你们能告诉我为什么会这样吗.
我正在通过愚蠢的代码加载 webview
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<WebView android:id="@+id/webView1" android:layout_width="match_parent" android:layout_height="match_parent"></WebView>
</LinearLayout>
这是代码,
WebView w=(WebView)findViewById(R.id.webView1);
w.loadDataWithBaseURL("http://www.mobilea.pcma.org/mobile/xml/sisap.asp?sid="+str+"&pn=AboutUs", Hold,"text/html", "utf-8",null);
异常详情:
01-31 06:27:54.768: W/Trace(1148): Unexpected value from nativeGetEnabledTags: 0
01-31 06:27:54.768: E/InputEventReceiver(1148): Exception dispatching input event.
01-31 06:27:54.778: D/AndroidRuntime(1148): Shutting down VM
01-31 06:27:54.778: W/dalvikvm(1148): threadid=1: thread exiting with uncaught exception (group=0x40a70930)
01-31 06:27:54.948: I/dalvikvm-heap(1148): Clamp target GC heap from 17.720MB to 16.000MB
01-31 06:27:54.948: D/dalvikvm(1148): GC_FOR_ALLOC freed 114K, 3% free 15984K/16384K, paused 49ms, total 51ms
01-31 06:27:55.129: E/AndroidRuntime(1148): FATAL EXCEPTION: main
01-31 06:27:55.129: E/AndroidRuntime(1148): android.view.InflateException: Binary XML file line #21: Error inflating class android.widget.ZoomControls
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.view.LayoutInflater.createView(LayoutInflater.java:613)
01-31 06:27:55.129: E/AndroidRuntime(1148): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.view.LayoutInflater.inflate(LayoutInflater.java:459)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.webkit.ZoomControlExternal$ExtendedZoomControls.<init>(ZoomControlExternal.java:124)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.webkit.ZoomControlExternal.createZoomControls(ZoomControlExternal.java:96)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.webkit.ZoomControlExternal.getControls(ZoomControlExternal.java:69)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.webkit.ZoomControlExternal.show(ZoomControlExternal.java:48)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.webkit.ZoomManager.invokeZoomPicker(ZoomManager.java:1208)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.webkit.WebViewClassic.startDrag(WebViewClassic.java:6321)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.webkit.WebViewClassic.handleTouchEventCommon(WebViewClassic.java:6025)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.webkit.WebViewClassic.onHandleUiTouchEvent(WebViewClassic.java:1398)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.webkit.WebViewClassic.onHandleUiEvent(WebViewClassic.java:1331)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.webkit.WebViewClassic.access$7200(WebViewClassic.java:146)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.webkit.WebViewClassic$PrivateHandler.dispatchUiEvent(WebViewClassic.java:7656)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.webkit.WebViewInputDispatcher.dispatchUiEvent(WebViewInputDispatcher.java:841)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.webkit.WebViewInputDispatcher.dispatchUiEvents(WebViewInputDispatcher.java:829)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.webkit.WebViewInputDispatcher.dispatchUiEvents(WebViewInputDispatcher.java:780)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.webkit.WebViewClassic.onTouchEvent(WebViewClassic.java:5825)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.webkit.WebView.onTouchEvent(WebView.java:1963)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.view.View.dispatchTouchEvent(View.java:7239)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2168)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1903)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2174)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2174)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2174)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2174)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917)
01-31 06:27:55.129: E/AndroidRuntime(1148): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1953)
01-31 06:27:55.129: E/AndroidRuntime(1148): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1405)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.app.Activity.dispatchTouchEvent(Activity.java:2410)
01-31 06:27:55.129: E/AndroidRuntime(1148): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1901)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.view.View.dispatchPointerEvent(View.java:7419)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:3220)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:3165)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:4292)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:4271)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:4363)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:179)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:171)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:4342)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:4382)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
01-31 06:27:55.129: E/AndroidRuntime(1148): at android.view.Choreographer.doCallbacks(Chore