//这是从html文件加载的地方
progres = ProgressDialog.show(activity, "Please wait!", "Loading...");
web.setWebViewClient(new WebViewClient() {
public void onReceivedError(WebView view, int errorCode, String
description, String failingUrl) {
Toast.makeText(activity, description,
Toast.LENGTH_SHORT).show();
}
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
progres.dismiss();
}
});
web.getSettings().setJavaScriptEnabled(true);
web.loadUrl("file:///android_assets/sample.html");
}
}
答案 0 :(得分:1)
web.loadUrl("file:///android_asset/sample.html");
android_asset not android_assets
答案 1 :(得分:0)
试试这个
web.loadUrl(getAssets().open("sample.html"));