android - can we share image and text both on gmail -


how share image , text both on gmail? here code can,t work.

intent shareintent = new intent(); shareintent.setaction(intent.action_send); shareintent.settype("image/png"); uri uri = uri.parse("android.resource://pakage name/"+r.drawable.image13); shareintent.putextra(intent.extra_stream, uri); shareintent.putextra(intent.extra_text, data ); startactivity(intent.createchooser(shareintent, "send image")); 

try using "*/*" mime, can send generic data type.

therefore send image , text,use below code

intent shareintent = new intent(android.content.intent.action_send);      shareintent.putextra(android.content.intent.extra_email, emailaddress); // if want add email address also.     shareintent.putextra(android.content.intent.extra_text, data);     shareintent.settype("*/*");      arraylist<uri> uris = new arraylist<uri>();      uris.add(uri.parse("android.resource://" + getpackagename() + "/" + r.drawable.image13));      shareintent.putextra(intent.extra_stream, uris);      startactivity(intent.createchooser(shareintent, "send image")); 

Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -