Share image with both setData and extra stream intent

pull/1052/head
inorichi 7 years ago
parent 23c0f2c313
commit 9714a30148

@ -575,9 +575,9 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>() {
uri = File(uri.toString().substringAfter("file://")).getUriCompat(this)
}
val intent = Intent(Intent.ACTION_SEND).apply {
setDataAndType(uri, "image/*")
putExtra(Intent.EXTRA_STREAM, uri)
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_GRANT_READ_URI_PERMISSION
type = "image/*"
}
startActivity(Intent.createChooser(intent, getString(R.string.action_share)))
}

Loading…
Cancel
Save