Skip to content

Commit

Permalink
Merge pull request #415 from FineFindus/refactor/sharing-img
Browse files Browse the repository at this point in the history
refactor(PhotoViewer): use getFileProviderUri
  • Loading branch information
LucasGGamerM authored May 26, 2024
2 parents b539972 + 965f7c6 commit 70686bb
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
import org.joinmastodon.android.model.Attachment;
import org.joinmastodon.android.model.Status;
import org.joinmastodon.android.ui.M3AlertDialogBuilder;
import org.joinmastodon.android.utils.FileProvider;
import org.joinmastodon.android.ui.utils.UiUtils;

import java.io.File;
import java.io.FileOutputStream;
Expand Down Expand Up @@ -647,7 +647,7 @@ private void shareAfterDownloading(Attachment att){

private void shareFile(@NonNull File file) {
Intent intent = new Intent(Intent.ACTION_SEND);
Uri outputUri = FileProvider.getUriForFile(activity, activity.getPackageName() + ".fileprovider", file);
Uri outputUri = UiUtils.getFileProviderUri(activity, file);
intent.setDataAndType(outputUri, mimeTypeForFileName(outputUri.getLastPathSegment()));
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent.putExtra(Intent.EXTRA_STREAM, outputUri);
Expand Down

0 comments on commit 70686bb

Please sign in to comment.