cordova - IBM Worklight 7.1-无法使用window.open在android设备中使用本地保存的文件,获取异常为“android.os.FileUriExposedException:”
问题描述
IBM MFP 7.1:使用 window.open() 打开本地保存的 PDF 文档时出现错误“android.os.FileUriExposedException:”。
"file:///storage/emulated/0/Android/data/com.trib.devicebee.oqic/files/healthcard_13.pdf";*
window.open(outputPath, "_system", "location=yes,hidden=no,closebuttoncaption=Close");
已将以下内容添加到 AndroidManifest.xml :
<provider android:authorities="com.sample.provider" android:exported="false" android:grantUriPermissions="true" android:name="android.support.v4.content.FileProvider">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/provider_paths"/>
</provider>
创建了 provide_paths.xml :
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-path name="external_files" path="."/>
解决方案
推荐阅读
- xml - XSLT for-each 匹配问题
- javascript - 如何从 JSON 文件获取属性到 EJS 文件?
- css - 如何为 Material UI 的 Tab 组件标签设置样式?
- r - 基于列表结构模式创建新列表
- svg - jquery 与 svg 路径交互以创建特定的可点击区域
- javascript - javascript unbind 事件即使被触发也不会解除绑定
- java - 无法让 BlobTrigger 让我的 Azure 函数正常工作?
- r - 删除具有大量变量的冗余行
- python-3.x - 如何从 datetime64 上的 YYYY-MM-DD 转换为 MM-DD 和绘图提示
- android - Android 旧版启动器图标尺寸和填充