jelic98
jelic98

Reputation: 713

FileProvider from getFilesDir()

What is the corresponding XML for Context.getFilesDir()?

My current XML:

<paths xmlns:android="http://schemas.android.com/apk/res/android">
    <files-path name="internal" path="." />
</paths>

File creation:

File video = new File(getFilesDir(), "movie.mp4");
videoUri = FileProvider.getUriForFile(this, "my.package.name.provider", video);

Upvotes: 7

Views: 1802

Answers (2)

Ivan
Ivan

Reputation: 6608

XML should be:

 <files-path
        name="avatar_image"
        path="camera" />

More info here

Upvotes: 0

CommonsWare
CommonsWare

Reputation: 1007554

That is the XML for serving files from getFilesDir() through FileProvider.

Upvotes: 6

Related Questions