android - how to share images from my app to whatsapp? -
here sharing images app whatsapp.but code working here mylist1[i] , not mylist2[i] , mylist3[i]. in activity file there 15 images in every list. do?
intent intent = new intent(); intent.setaction(intent.action_send); intent.settype("image/*"); uri uri = uri.parse("android.resource://com.example.drawcelebrities/"+mylist1[i]+mylist2[i]+mylist3[i]); intent.putextra(intent.extra_stream, uri); startactivity(intent.createchooser(intent, "share via"));
take image array in mylist[] , use below code, share image via whatsapp.
uri uri = uri.parse("android.resource://"+getpackagename()+"/"+mylist[i]); intent shareintent = new intent(); shareintent.setaction(intent.action_send); shareintent.settype("image/*"); shareintent.putextra(intent.extra_stream, uri); startactivity(intent.createchooser(shareintent, "share via"));
Comments
Post a Comment