【发布时间】:2014-06-06 21:10:24
【问题描述】:
是否可以让其他应用程序使用 FileProvider ?
manifest.xml
...
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="com.example.myapp.fileprovider"
android:exported="true"
android:grantUriPermissions="false"
android:permission="com.example.filesvisible.permission.READ" >
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/filespath" />
</provider>
...
来自doc:
false:提供程序不可用于其他应用程序。放 android:exported="false" 将提供程序的访问权限限制为您的 应用程序。仅具有相同用户 ID (UID) 的应用程序 提供者将有权访问它。
我尝试将导出设置为 true,但出现此异常
Unable to get provider android.support.v4.content.FileProvider: java.lang.SecurityException: Provider must not be exported 为什么我不能导出 FileProvider ?
【问题讨论】:
标签: android provider android-contentresolver android-fileprovider