Logo Icon Logo
A Crowd-sourced Cookbook on Writing Great Android® Apps
GitHub logo Twitter logo OReilly Book Cover Art
Sharing Files with a FileProviderBack to Android Cookbook Home | Up to Chapter: Data Persistence

Author: Ian Darwin ('idarwin')
In Published Edition? Yes
FormatLanguage: WikiFormat

Sharing Files with a FileProvider

Problem

You want to share internal-storage files (see <<r5028>>) with another app, without the bother of putting the data into a Cursor and creating a ContentProvider.

Solution

The ++FileProvider++ class allows you to make files available to another application, usually in response to an ++Intent++. It is simpler to set up than a Content Provider (<<r1558>>), but is actually a subclass of ++ContentProvider++.

Discussion

To follow

See Also