i would like to send an image using android implicit intents.So my code is
Uri imageUri = Uri.parse("android.resource://com.example.intenttest/drawble/"+R.drawable.che3);
intent = new Intent(Intent.ACTION_SEND);
intent.setType("image/*");
intent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Image Sending");
intent.putExtra(android.content.Intent.EXTRA_TEXT, "I AM ATTACHED THIS IMAGE");
intent.putExtra(Intent.EXTRA_STREAM, imageUri);
chooser = Intent.createChooser(intent, "Send Image");
startActivity(chooser);
the name of the image is che3.gif which is in drawable folder.And i tried with png format also i read the stackoverflow questions this and this i followed the first one but of no use .And it gives the error like unable to determine the mime type.The below is the log cat
I/ActivityManager( 287): START u0 {act=android.intent.action.SEND typ=image/png flg=0x3000001 cmp=com.android.email/.activity.MessageCompose (has clip) (has extras)} from pid 2180
E/Email ( 749): Unable to determine MIME type for uri=android.resource://com.example.intenttest/drawble/2130837504
E/Email ( 749): java.lang.Error
E/Email ( 749): at com.android.emailcommon.utility.AttachmentUtilities.inferMimeTypeForUri(AttachmentUtilities.java:251)
E/Email ( 749): at com.android.email.activity.MessageCompose.loadAttachmentInfo(MessageCompose.java:1607)
E/Email ( 749): at com.android.email.activity.MessageCompose.addAttachmentFromSendIntent(MessageCompose.java:1674)
E/Email ( 749): at com.android.email.activity.MessageCompose.initFromIntent(MessageCompose.java:2028)
So can any one please help me