xmlns:tools="http://schemas.android.com/tools">

       //加权限

android:name="androidx.core.content.FileProvider"

android:authorities="com.fv.smartbookcase.fileprovider"

android:exported="false"

android:grantUriPermissions="true">

android:name="android.support.FILE_PROVIDER_PATHS"

android:resource="@xml/file_paths" />

在res下的xml下创建file_files.xml

WebSettings settings = mWVH5.getSettings();

//允许webview对文件的操作

settings.setAllowUniversalAccessFromFileURLs(true);

settings.setAllowFileAccess(true);

settings.setAllowFileAccessFromFileURLs(true);

// file:///"手机存储的文件路径"

java Android开发 WebView访问手机存储的图片  第1张

精彩文章

评论可见,请评论后查看内容,谢谢!!!
 您阅读本篇文章共花了: