我正从下载管理器下载html文件。该文件正在下载,但无法加载到webview中。
我想html
存在一些问题。
下载代码:
PATH
文件加载代码:
public void myDownload(String myURL, String title, String year, String branch, String section) {
DownloadManager.Request request = new DownloadManager.Request(Uri.parse(myURL));
request.setTitle("File Download");
request.setDescription("Downloading....");
//request.setAllowedNetworkTypes(DownloadManager.Request.NETWORK_WIFI);
request.allowScanningByMediaScanner();
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
String nameOfFile = URLUtil.guessFileName(myURL, null, MimeTypeMap.getFileExtensionFromUrl(myURL));
request.setDestinationInExternalPublicDir(Environment.getExternalStorageDirectory().getPath() + "/KiiTTimeTableData/" + year + "/" + branch + "/" + section + "/", nameOfFile);
//request.setDestinationInExternalPublicDir("/sdcard/KiiTTimeTableData/" + year + "/" + branch + "/" + section + "/", nameOfFile);
DownloadManager manager = (DownloadManager) getActivity().getSystemService(Context.DOWNLOAD_SERVICE);
manager.enqueue(request);
}