Android: Send MMS Message With Picture on SDCard

后端 未结 1 1516
说谎
说谎 2021-01-07 15:02

Hi so I\'m trying to send an image (png) from the sdcard in an MMS message. I\'m using the ACTION_SEND intent, but it doesn\'t seem to be working.

Intent sen         


        
相关标签:
1条回答
  • 2021-01-07 15:50

    I ended up finding the solution: it's looking for a file, not a content stream or straight URI. This made it work for me:

    Intent sendIntent = new Intent(Intent.ACTION_SEND);
    sendIntent.putExtra("sms_body", "Sent using Spootur");
    sendIntent.setType("image/png");
    sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File(imagePath)));
    startActivityForResult(sendIntent, SEND_ACTIVITY);
    

    Hope this helps someone

    0 讨论(0)
提交回复
热议问题