I have a app read files html (saved on device), some time it is xhmtl and it have some hashtag in the end, example myLink=:
/data/user/0/com.example.beta5/cache/1628480735545/texts/Ch-10.xhtml#toc_10
I process the file like this, but the webview show error: "File not found"
WebView webView;
webView = findViewById(R.id.webview);
WebSettings webSettings = webView.getSettings();
webSettings.setAllowContentAccess(true);
webSettings.setAllowFileAccess(true);
webSettings.setJavaScriptEnabled(true);
webView.loadUrl(link);
or this was not better
File file = new File(myLink);
Uri uri = Uri.fromFile(file);
webView.loadUrl(String.valueOf(uri));
I notice that the link above was changed the character # become %
Anyone have a solution for this?