android - Image is not attached to intent -
string url = mediastore.images.media.insertimage(getcontentresolver(), v.getdrawingcache(), "title", null); final intent intent = new intent( android.content.intent.action_send); intent.setflags(intent.flag_activity_new_task); intent.putextra(intent.extra_stream, url); intent.settype("image/*"); startactivity(intent.createchooser(intent, getresources().gettext(r.string.send_to)));
when choose app chooser doesn't see image
try below code...
public void addattachments(view v) { intent intent = new intent(android.content.intent.action_send); intent.settype("application/image"); intent.putextra(intent.extra_stream, uri.parse("file:///mnt/sdcard/testimage.jpeg")); startactivity(intent.createchooser(intent, getresources().gettext(r.string.send_to))); }
Comments
Post a Comment