3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

FileProviderでexternal-files-pathとexternal-cache-pathは使えない

Posted at

Android v4 Support Library の FileProvider を使うとき、

file_paths.xml
<paths xmlns:android="http://schemas.android.com/apk/res/android">
    <files-path name="my_images" path="images/"/>
    <files-path name="my_docs" path="docs/"/>
</paths>

のようなXMLを使いますが、ドキュメント によると paths の中には5種類の要素が使えるとありますがそれは嘘です。

以下の通り、実際には3種類しか使えません。

element directory
files-path Context.getFilesDir()
cache-path Context.getCacheDir()
external-path Environment.getExternalStorageDirectory()
external-files-path ugh! 使えません!
external-cache-path ugh! 使えません!

ソースコード みたら実際に実装されてませんでした。
ドキュメントバグじゃんってissue も上がってました

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?