0

I am currently sending a message with a drawable using this code...

    global.fileUri = Uri.parse("android.resource://com.flipable.flipable/drawable/fliptest");

    Intent sendIntent = new Intent(Intent.ACTION_SEND);
    sendIntent.setType("image/png");
    sendIntent.putExtra(Intent.EXTRA_STREAM,global.fileUri);
    startActivity(sendIntent);

The problem with this is that drawable type (.png) is not getting picked up. So, if I send over email, it works, and it sends as an extentionless file. but over SMS, it doesn't work because the extension is missing.

How do I send a drawable file over SMS? Is there a simple way to rename the file to send, so that SMS recognizes it? Something like...

    sendIntent.putExtra(Intent.STREAM_NAME, "FILE_NAME.PNG");
  • Rather MMS, than SMS - https://stackoverflow.com/questions/13818138/how-to-attach-image-to-mms-from-drawable-in-android – Raptor Feb 08 '18 at 20:20
  • The real goal is to send a preloaded .png. I dont want to have to prompt the user if I dont have to. Perhaps I can store it as an asset? – Jacob Levinson Feb 08 '18 at 20:33
  • SMS is text only. SMS does not send images. When you look like you get an image texted to you, they're really sending an MMS – Gabe Sechan Feb 08 '18 at 20:47
  • I must be sending an MMS then. Thats my bad. I didnt realize the distinction. I used the same method to send a uri I got from a file open intent. – Jacob Levinson Feb 08 '18 at 21:11

0 Answers0