Android webview

webview 使用过程中

android.webkit.WebView 在使用setWebViewClient时,必须直接调用webkit.WebViewClient;

如果使用 一下方法,webview不会显示加载出来的画面

/*  wv_produce.setWebViewClient(new WebViewClient() {

@Override

public boolean shouldOverrideUrlLoading(WebView view, String url) {

          // TODO Auto-generated method stubreturn true;

}

@Override

public void onPageStarted(WebView view, String url, Bitmap favicon) {

super.onPageStarted(view, url, favicon);

}

@Override

public void onPageFinished(WebView view, String url) {

super.onPageFinished(view, url);

Log.e("webview===", "加载完成");

wv_produce.setVisibility(View.VISIBLE);

}

@Override

public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {

super.onReceivedError(view, errorCode, description, failingUrl);

Log.e("webview===", "加载错");

}

  });*/


webView 的设置

wv_produce.getSettings().setAllowFileAccess(true);

wv_produce.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);

wv_produce.getSettings().setAppCacheEnabled(true);

wv_produce.getSettings().setDomStorageEnabled(true);

wv_produce.getSettings().setLoadWithOverviewMode(true);//打开预载页面

wv_produce.getSettings().setDatabaseEnabled(true);

你可能感兴趣的:(Android webview)