Address some build warnings
This commit is contained in:
@@ -4,12 +4,12 @@ import android.content.ClipData
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
|
||||
fun Uri.toShareIntent(): Intent {
|
||||
fun Uri.toShareIntent(type: String = "image/*"): Intent {
|
||||
val uri = this
|
||||
return Intent(Intent.ACTION_SEND).apply {
|
||||
putExtra(Intent.EXTRA_STREAM, uri)
|
||||
clipData = ClipData.newRawUri(null, uri)
|
||||
type = "image/*"
|
||||
setType(type)
|
||||
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_GRANT_READ_URI_PERMISSION
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user