
的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: The provIDer is not available to other applications. Set
androID:exported=”false” to limit access to the provIDer to your
applications. Only applications that have the same user ID (UID) as
the provIDer will have access to it.
我试图将导出设置为true但我得到了这个例外
无法获取提供程序androID.support.v4.content.fileProvIDer:java.lang.SecurityException:不能导出提供程序为什么我无法导出fileProvIDer?
Is it possible to have a fileProvIDer available to other applications ?
是.这通常就是重点.
Why I can’t export a fileProvIDer ?
因为这不是您使用fileProvIDer的方式.
fileProvIDer背后的点是give select access to files to third-party apps.您可以通过FLAG_GRANT_READ_URI_PERMISSION和/或FLAG_GRANT_WRITE_URI_PERMISSION在用于将您的提供者的Uri值之一传递给第三方应用程序的Intent中执行此 *** 作(例如,通过与startActivity一起使用的ACTION_VIEW Intent( )).
另见the training guide on sharing files.
总结以上是内存溢出为你收集整理的android – 如何使FileProvider可用于其他应用程序?全部内容,希望文章能够帮你解决android – 如何使FileProvider可用于其他应用程序?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)