79332868

Date: 2025-01-06 11:28:57
Score: 2.5
Natty:
Report link

From looking at Android's source code at:

https://android.googlesource.com/platform/packages/apps/Browser2/+/master/src/org/chromium/webview_shell/WebViewBrowserActivity.java

It appears that WebView settings are necessary but not sufficient:

    private void loadUrl(String url) {
        // Request read access if necessary
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
                && "file".equals(Uri.parse(url).getScheme())
                && PackageManager.PERMISSION_DENIED
                        == checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE)) {
            requestPermissionsForPage(new FilePermissionRequest(url));
        }
        // If it is file:// and we don't have permission, they'll get the "Webpage not available"
        // "net::ERR_ACCESS_DENIED" page. When we get permission, FilePermissionRequest.grant()
        // will reload.
        mWebView.loadUrl(url);
        mWebView.requestFocus();
    }

Did you include in your AndroidManifest.xml the following?

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Low reputation (0.5):
Posted by: ususer