我在对话活动中实现的WebView和我加载简单的URL为网页流量。
我的网页视图设置如
wbView = (WebView) findViewById(R.id.wbView);
wbView.setKeepScreenOn(true);
wbView.getSettings().setJavaScriptEnabled(true);
wbView.getSettings().setDomStorageEnabled(true);
wbView.getSettings().setBuiltInZoomControls(true);
wbView.setInitialScale(100);
// wbView.getSettings().setUseWideViewPort(true);
wbView.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY);
wbView.setWebViewClient(new MyWebViewClient());
和MyWebViewClient()包含
private class MyWebViewClient extends WebViewClient {
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
prgBar.setVisibility(View.GONE);
}
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler,
SslError error) {
Log.e("Error VAGARO", error.toString());
prgBar.setVisibility(View.GONE);
handler.proceed();
}
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return false;
}
}
我加载从资产两个HTML文件在同一网页视图其工作正常,但无法加载动态链接。
我谷歌和找到一些帖子http://code.google.com/p/android/issues/detail?id=21177
我logcat的表明了我
05-09 13:33:30.187: W/webcore(20054): java.lang.Throwable: EventHub.removeMessages(int what = 107) is not supported before the WebViewCore is set up.
05-09 13:33:30.187: W/webcore(20054): at android.webkit.WebViewCore$EventHub.removeMessages(WebViewCore.java:1683)
05-09 13:33:30.187: W/webcore(20054): at android.webkit.WebViewCore$EventHub.access$7900(WebViewCore.java:926)
05-09 13:33:30.187: W/webcore(20054): at android.webkit.WebViewCore.removeMessages(WebViewCore.java:1795)
05-09 13:33:30.187: W/webcore(20054): at android.webkit.WebView.sendOurVisibleRect(WebView.java:2917)
05-09 13:33:30.187: W/webcore(20054): at android.webkit.ZoomManager.setZoomScale(ZoomManager.java:593)
05-09 13:33:30.187: W/webcore(20054): at android.webkit.ZoomManager.access$1700(ZoomManager.java:49)
05-09 13:33:30.187: W/webcore(20054): at android.webkit.ZoomManager$PostScale.run(ZoomManager.java:984)
05-09 13:33:30.187: W/webcore(20054): at android.os.Handler.handleCallback(Handler.java:605)
05-09 13:33:30.187: W/webcore(20054): at android.os.Handler.dispatchMessage(Handler.java:92)
05-09 13:33:30.187: W/webcore(20054): at android.os.Looper.loop(Looper.java:137)
05-09 13:33:30.187: W/webcore(20054): at android.app.ActivityThread.main(ActivityThread.java:4424)
05-09 13:33:30.187: W/webcore(20054): at java.lang.reflect.Method.invokeNative(Native Method)
05-09 13:33:30.187: W/webcore(20054): at java.lang.reflect.Method.invoke(Method.java:511)
05-09 13:33:30.187: W/webcore(20054): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
05-09 13:33:30.187: W/webcore(20054): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
05-09 13:33:30.187: W/webcore(20054): at dalvik.system.NativeStart.main(Native Method)
推荐我,我应该做出改变。
更新
我发现,如果我会通过任何网址,如“www.facebook.com”,那么它给我这个错误,但如果我将与“https://www.facebook.com”,那么它的工作的罚款代替它。