Get attachment URI with name

This commit is contained in:
M66B
2023-01-05 15:21:22 +01:00
parent 35259ba80a
commit 2e07080feb
3 changed files with 14 additions and 13 deletions

View File

@@ -299,13 +299,9 @@ public class AdapterAttachment extends RecyclerView.Adapter<AdapterAttachment.Vi
private boolean onShare(final EntityAttachment attachment) {
try {
File file = attachment.getFile(context);
Uri uri = FileProvider.getUriForFile(context, BuildConfig.APPLICATION_ID, file);
// TODO: consider using getUriForFile(..., displayName)
new ShareCompat.IntentBuilder(context)
.setType(attachment.getMimeType())
.addStream(uri)
.addStream(attachment.getUri(context))
.setChooserTitle(R.string.title_select_app)
.startChooser();