I want to send an image using Android Instant Intents. So my code is
Uri image URI = 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, "sending an image"); Intent.putExtra (android.content.Intent.EXTRA_TEXT, "I have attached this image"); Intent.putExtra (Intent.EXTRA_STREAM, imageUri); Selector = Intent. Creator selector (intent, "send picture"); StartActivity (selector);
The name of the image is che3.gif which is in the drawable folder. And I tried with PGF format, I also read and I first followed one but it has no advantage. Error log is like the unable to set the mime type. Below.
I / ActivityManager (287): Start u0 {task = android.intent.action.SEND typ = image / Png FLG = 0x3000001 CMP = com.android.email / .activity.MessageCompose (Clip) is PID 2180 (Extra)} E / Email (749): Unable to determine MIME type uri = android Resource: / /com.example.intenttest/drawble/2130837504 E-mail (749): java.lang.Error E / Email (749): com.android.emailcommon.utility.AttachmentUtilities.inferMimeTypeForUri (AttachmentUtilities.java:251) ) E / Email (749): com.android.email.activity.MessageCompose.loadAttachmentInfo (MessageCompos) E.java:1607) E / Email (749): email.activity.MessageCompose on com.android: com.android.email.activity.MessageCompose.addAttachmentFromSendIntent (MessageCompose.java:1674) e / email (749) at: com.android InitFromIntent (MessageCompose.java2028)
Any one can please help me
This does not work because:
- You can not access the processing of an application in another
- You can not send the dresses to your mime" Image ".
You can write an image for a publicly accessible bitmap file and that will have to pass a path, or implement a ContentProvider.
Comments
Post a Comment