1

I'm trying to load the ".mht" file that I saved using

File file = new File(getFilesDir(), FilenameUtils.getBaseName(url));
    webView.saveWebArchive("file://" + file.getAbsolutePath() + ".mht");

and tried to load it with the following code

webView.loadUrl("file:///" + Environment.getExternalStorageDirectory()
                + File.separator + "myArchive" + ".mht");

and this is what I kept getting

enter image description here

seems the Webview doesn't support ".mht" files so I tried using this answer but couldn't find the libraries they mentioned

I have searched everywhere for the solution most people are just throwing expired links that don't work as an answer. hope someone helps me to achieve that

Abdlhay
  • 61
  • 1
  • 8

1 Answers1

1

you need:

webView.getSettings().setAllowFileAccess(true);
Procrastinator
  • 2,526
  • 30
  • 27
  • 36
James
  • 36
  • 4