发送最新图片与whatsapp联系

时间:2013-08-15 19:58:42

标签: android facebook android-camera whatsapp

Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.setType("text/plain");
String text = "Text";
sendIntent.setPackage("com.whatsapp");
if (sendIntent != null) {
   sendIntent.putExtra(Intent.EXTRA_TEXT, text);//
   startActivity(Intent.createChooser(sendIntent, "phone number"));

我正在使用相机默认设置在Eclipse上的Android上开发应用程序,应用程序应该拍照并将图片发送到whatsapp上联系。我想知道如何将最后一张照片发送给whatsapp或邮件或Facebook Messenger上的联系人。

1 个答案:

答案 0 :(得分:0)

您可以为Android App添加共享功能。 这里是链接:http://developer.android.com/training/sharing/shareaction.html

<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:id="@+id/menu_item_share"
    android:showAsAction="ifRoom"
    android:title="Share"
    android:actionProviderClass="android.widget.ShareActionProvider" />
...
</menu>

对于意图分享,请查看以下链接:

Android: how to add app to "Share via" list for camera picture

Vrinda

相关问题