YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.util.ShareFileTask Class Reference

Copies a single item's resource into the app's cache (not the user-visible Downloads folder - this copy only exists to be handed to another app, not for the user to keep) and hands it off to the system share sheet as a content:// URI via FileProvider, rather than just sharing the resource's own URI as text - an http(s) URL is often only reachable on the local network (this device's own embedded UPnP server, or another server on the same LAN), and a content:// URI isn't a shareable link at all, so the receiving app/person frequently can't actually resolve either as plain text. More...

Inheritance diagram for de.yaacc.util.ShareFileTask:
Inheritance graph
Collaboration diagram for de.yaacc.util.ShareFileTask:
Collaboration graph

Public Member Functions

 ShareFileTask (Context context, Uri sourceUri, String title, String mimeType)
 

Protected Member Functions

File doInBackground (Void... voids)
 
void onPostExecute (File file)
 

Detailed Description

Copies a single item's resource into the app's cache (not the user-visible Downloads folder - this copy only exists to be handed to another app, not for the user to keep) and hands it off to the system share sheet as a content:// URI via FileProvider, rather than just sharing the resource's own URI as text - an http(s) URL is often only reachable on the local network (this device's own embedded UPnP server, or another server on the same LAN), and a content:// URI isn't a shareable link at all, so the receiving app/person frequently can't actually resolve either as plain text.

sourceUri may be http(s):// (fetched via a plain connection, same as de.yaacc.util.FileDownloader) or a local content:///file:// URI (read via the android.content.ContentResolver, same as de.yaacc.imageviewer.ImageFragment's non-http branch) - callers don't need to know which.

See also
de.yaacc.browser.BrowseContentItemAdapter
de.yaacc.imageviewer.ImageViewerActivity

The documentation for this class was generated from the following file: