mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-11-22 15:48:54 +01:00
Share: use ACTION_SEND when sharing a single track so apps like Signal are offered as share target (#2405).
This commit is contained in:
@@ -62,6 +62,15 @@ public class ShareUtils {
|
||||
mime = uriAndMime.second;
|
||||
}
|
||||
|
||||
if (uris.size() == 1) {
|
||||
return new Intent(Intent.ACTION_SEND)
|
||||
.setType(mime)
|
||||
.putExtra(Intent.EXTRA_STREAM, uris.get(0))
|
||||
.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
|
||||
.putExtra(Intent.EXTRA_SUBJECT, context.getString(R.string.share_track_subject))
|
||||
.putExtra(Intent.EXTRA_TEXT, context.getString(R.string.share_track_share_file_body, trackDescription));
|
||||
}
|
||||
|
||||
return new Intent(Intent.ACTION_SEND_MULTIPLE)
|
||||
.setType(mime)
|
||||
.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris)
|
||||
|
||||
Reference in New Issue
Block a user