Sending text and and Image simultaneously in android -


in application, requirement send image , text simultaneously. use following code

intent share = new intent(intent.action_send); share.settype("image/jpeg"); share.putextra(intent.extra_text, "my photos"); share.putextra(intent.extra_stream, uri.parse("file:///"+f));                        startactivity(intent.createchooser(share, "share image")); 

but image sended text not sending. how can solve problem?

plz try this

//assuming uris list of uri

intent intent = null; if (uris.size > 1){ intent = new intent(intent.action_send_multiple); intent.putparcelablearraylistextra(intent.extra_stream, uris); } else if (uris.size() == 1) { intent = new intent(intent.action_send); intent.putextra(intent.extra_stream, uris.get(0));} intent.settype("image/*"); intent.putextra(intent.extra_text, "some message"); startactivity(intent.createchooser(intent,"compatible apps:")); 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -