9
Udostępniam moje obrazy za pośrednictwem WhatsApp - ale muszę wybrać odbiorcę. Oto mój kod:Wysyłanie obrazu za pośrednictwem WhatsApp do określonego odbiorcy (Android)
public static void shareImage(Context context,String path, String text, String otherAppPackage){
Intent share = new Intent(Intent.ACTION_SEND);
share.setType("image/*");
share.setPackage("com.whatsapp");
share.putExtra(android.content.Intent.EXTRA_SUBJECT, getSubject(context));
if (text!=null){
share.putExtra(Intent.EXTRA_TEXT,text);
}
if (path!=null){
share.putExtra(Intent.EXTRA_STREAM,
Uri.fromFile(new File(path)));
}
context.startActivity(Intent.createChooser(share, context.getString(R.string.share_via)));
}
I wold się podzielić z kimś bezpośrednio. Czy niektórzy z was wiedzą, jak to zrobić. Dzięki
możliwe duplikat [Wysyłanie wiadomości przez WhatsApp] (http://stackoverflow.com/questions/15462874/sending- message-through-whatsapp) – rds
znalazłeś coś? –