开发者

getContentResolver().openOutputStream(uri) No files supported by provider

开发者 https://www.devze.com 2023-01-20 11:54 出处:网络
I want store a file audio in my personal content provider. i save record: Uri uri = getContentResolver().insert(CONTENT_URI, values);

I want store a file audio in my personal content provider. i save record:

Uri uri = getContentResolver().insert(CONTENT_URI, values); OutputStream os = getContentResolver().openOutputStream(uri);

but getContentResolver().openOutputStream(uri); throws:

10-13 19:44:53.903: ERROR/TAB(5679): No fi开发者_如何学运维les supported by provider at content://com.memento.data.provider.MementoProvider/audionotes/6 10-13 19:44:53.903: ERROR/TAB(5679): java.io.FileNotFoundException: No files supported by provider at content://com.memento.data.provider.MementoProvider/audionotes/6 10-13 19:44:53.903: ERROR/TAB(5679): at android.content.ContentProvider.openFile(ContentProvider.java:585)

I have a column named _data for that purpose.


You are a little sparse here. I presume you have a custom ContentProvider?

In any case take a look at How to store large blobs in an android content provider?

(I answered my own question there so I won't reproduce it here.)

It sounds like your ContentProvider isn't matching the uri.

0

精彩评论

暂无评论...
验证码 换一张
取 消