feat(PhotoViewer): rich previews for image sharing
This commit is contained in:
parent
f4a94bc42e
commit
c0ab3a47ae
|
@ -648,7 +648,8 @@ public class PhotoViewer implements ZoomPanView.Listener{
|
||||||
private void shareFile(@NonNull File file) {
|
private void shareFile(@NonNull File file) {
|
||||||
Intent intent = new Intent(Intent.ACTION_SEND);
|
Intent intent = new Intent(Intent.ACTION_SEND);
|
||||||
Uri outputUri = FileProvider.getUriForFile(activity, activity.getPackageName() + ".fileprovider", file);
|
Uri outputUri = FileProvider.getUriForFile(activity, activity.getPackageName() + ".fileprovider", file);
|
||||||
intent.setType(mimeTypeForFileName(outputUri.getLastPathSegment()));
|
intent.setDataAndType(outputUri, mimeTypeForFileName(outputUri.getLastPathSegment()));
|
||||||
|
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||||
intent.putExtra(Intent.EXTRA_STREAM, outputUri);
|
intent.putExtra(Intent.EXTRA_STREAM, outputUri);
|
||||||
activity.startActivity(Intent.createChooser(intent, activity.getString(R.string.button_share)));
|
activity.startActivity(Intent.createChooser(intent, activity.getString(R.string.button_share)));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue