1

currently in preview its showing text,but i want image to be shown in preview instead of text

  val bitmapUri = Uri.parse(path)
    val intent = Intent(Intent.ACTION_SEND_MULTIPLE)
    val share = Intent.createChooser(Intent().apply {
        intent.type = "image/*"
        action = Intent.ACTION_SEND_MULTIPLE
        putExtra(
            Intent.EXTRA_TEXT,
            "NcQAvD_BwE"
        )

       // to share image URL
        putExtra(Intent.EXTRA_STREAM, bitmapUri)

       
    }, null)
    startActivity(share)
  • First, use a concrete MIME type, not `image/*`. It is *your* content that you are sharing. It is *your* job to indicate what the MIME type is. Second, `Uri.parse(path)` does not look promising. Where is `path` coming from, and what is its value? Third, you will need to set the `clipData` as well: https://commonsware.com/blog/2021/01/07/action_send-share-sheet-clipdata.html – CommonsWare Jul 22 '22 at 16:42
  • were you able to figure out? – Rohit Singh Sep 16 '22 at 22:01

0 Answers0