I'm getting image urls from server now i want to share same urls to another application but its says that:
The File format is not supported
here is my code :
private fun shareImages(urls:List<String>?) {
var listOfImageUri = ArrayList<Uri>()
for (i in urls!!.indices) {
listOfImageUri.add( Uri.parse(urls[i].url))
}
val shareIntent: Intent = Intent().apply {
action = Intent.ACTION_SEND_MULTIPLE
putParcelableArrayListExtra(Intent.EXTRA_STREAM, listOfImageUri)
type = "image/*"
flags = Intent.FLAG_GRANT_READ_URI_PERMISSION
}
try {
startActivity(Intent.createChooser(shareIntent, "Share Via:"))
} catch (e: ActivityNotFoundException) {
Toast.makeText(baseActivity, "No App Available", Toast.LENGTH_SHORT).show()
}
}
The link i have tried so for: share multiple images Android Share Multiple Images with Other Apps
Note: during image sharing process i do not want to save image into SD card
Please help ..Any help is Appreciated.