我想将网页保存到本地。
我发现有一种方法可以将网页保存为存档文件。
public void saveWebArchive (String filename)
但是,当我加载文件时,除了乱码什么也没有。
WebView webView = (WebView) rootView.findViewById(R.id.webview_layout);
String url = "http://www.yahoo.com";
webView.loadUrl(url);
String path = getFilesDir().getAbsolutePath() + File.separator + "yahoo" + ".html";
webView.saveWebArchive(path);
webView.loadUrl("file://" + path);
我究竟做错了什么?