0
//這是從那裏的HTML文件加載找不到文件的錯誤時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");
}
}
最後,我得到了我的解決方案o wn問題,我從資產文件夾路徑中刪除了「s」,例如「file:///android_asset/sample.html」 –