I am trying to download HTML files from server then load it in webview. The files are being downloaded but they are not loading in the webview. Webview says net::ERR_FILE_NOT_FOUND even after restarting the app when the download completes. 
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    webView = (WebView) findViewById(R.id.webView);
    button = (Button) findViewById(R.id.button);
    webView.loadUrl("file://"+Environment.DIRECTORY_DOWNLOADS+File.separator+"test.html");
    Log.e("CHECKKK", String.valueOf(Environment.DIRECTORY_DOWNLOADS+File.separator+"test.html"));
    button.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            try {
                myDownload("http://xxxxxx.com/xxxx/test.html");
                myDownload("http://xxxxxx.com/xxxx/mypic1.jpg");
            } catch (Exception e) {
                Toast.makeText(MainActivity.this, e.getMessage() + "\n" + e.getCause(), Toast.LENGTH_LONG).show();
            }
        }
    });
}
public void myDownload(String myURL) {
    DownloadManager.Request request = new DownloadManager.Request(Uri.parse(myURL));
    request.setTitle("File Download");
    request.setDescription("Downloading....");
    request.allowScanningByMediaScanner();
    request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
    String nameOfFile = URLUtil.guessFileName(myURL, null, MimeTypeMap.getFileExtensionFromUrl(myURL));
    request.setDestinationInExternalFilesDir(this,Environment.DIRECTORY_DOWNLOADS, nameOfFile);
    DownloadManager manager = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE);
    manager.enqueue(request);
}
 
     
    