Compartilhar imagem e texto através do whatsapp
Eu uso o seguinte código para compartilhar uma imagem e texto através do WhatsApp. Apenas compartilha a imagem, não o texto, no entanto. Eu procurei por toda a Internet, mas não encontrei uma solução.
String message = Fname + Mobileno + Homeno + Workmail + Homemail
+ Gtalk + Skype + Address + Company + Title + Website;
Intent shareIntent = new Intent(Intent.ACTION_SEND);
Uri uri = Uri.parse("file://"
+ Environment.getExternalStorageDirectory()
+ "/Talk&Share/Images/profpic.png");
shareIntent.putExtra(Intent.EXTRA_TEXT, message);
shareIntent.putExtra(Intent.EXTRA_SUBJECT, "Contact");
if(uri != null){
shareIntent.putExtra(Intent.EXTRA_STREAM, uri);
shareIntent.setType("image/plain");
}else{
shareIntent.setType("plain/text");
}
return shareIntent;