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

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -