内容提供商,文件存储在哪里?
文档中说“但是,如果要添加大量二进制数据,例如照片或完整的歌曲,请在表中放置数据的 content: URI 并调用 ContentResolver.openOutputStream() 与文件的 URI (这会导致内容提供者将数据存储在文件中,并将文件路径记录在记录的隐藏字段中。)”。
文件存储在内部还是外部存储器上?内容提供商还管理文件的生命周期,即删除记录时会被破坏吗?
The documentation says "However, if you have a large amount of binary data to add, such as a photograph or a complete song, put a content: URI for the data in the table and call ContentResolver.openOutputStream()
with the file's URI. (That causes the content provider to store the data in a file and record the file path in a hidden field of the record.)".
Is the file stored on internal or external storage? Also does the content provider manage the life of the file, i.e. gets destroyed when the record is deleted?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我非常确定该文件不会被内容提供商删除,您需要自行处理它。至于它的存储位置 - 它位于手机内容提供商内。存储后,您可以查询它以检索数据。请参阅此链接。
Im pretty sure the file does not get deleted by the content provider, you will need to dispose of it your self. As far as where it is stored - its within the phones content provider. You can query it to retrieve your data once its stored. See this link.