相关疑难解决方法(0)

Android和Facebook分享意图

我正在开发一个Android应用程序,我很想知道如何使用Android的共享意图从应用程序内更新应用程序用户的状态.

通过浏览Facebook的SDK看起来这很容易做到,但是我很想让用户通过常规的Share Intent弹出窗口来完成它吗?看到这里:

弹出

我尝试过通常的共享意图代码,但这似乎不适用于Facebook.

public void invokeShare(Activity activity, String quote, String credit) {
    Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
    shareIntent.setType("text/plain");
    shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, activity.getString(R.string.share_subject));
    shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Example text");    

    activity.startActivity(Intent.createChooser(shareIntent, activity.getString(R.string.share_title)));
}
Run Code Online (Sandbox Code Playgroud)

更新:进行了更多的挖掘,看起来这是Facebook的应用程序的一个错误尚未解决!(facebook bug)对于平均时间,看起来我只能忍受负面的"分享不起作用!!!" 评论.干杯Facebook:*(

android facebook android-intent

81
推荐指数
4
解决办法
13万
查看次数

我怎样才能在Twitter上发布Intent Action_send?

我一直在努力将文本从我的应用程序发送到Twitter.

下面的代码用于显示蓝牙,Gmail,Facebook和Twitter等应用程序列表,但是当我选择Twitter时,它不会像我预期的那样预填充文本.

我知道围绕Facebook做这个问题有一些问题,但我必须做错事才能与Twitter合作.

Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TEXT, "Example Text");
startActivity(Intent.createChooser(intent, "Share Text"));
Run Code Online (Sandbox Code Playgroud)

twitter android share android-intent

12
推荐指数
4
解决办法
2万
查看次数

Android如何使用intent发送文本和图像或任何对象?

我知道可以ACTION_SEND通过指定来共享文本消息Intent.EXTRA_TEXT.相同的方法适用于图像 - Intent.EXTRA_STREAM.

但是,如何将文本和图像添加到同一意图中?

android text share image android-intent

3
推荐指数
1
解决办法
6146
查看次数

如何从我的应用程序发送图像到WhatsApp?

2013年7月,WhatsApp为我们的应用程序开放了他们的URL方案.我已经从我的应用程序发送文本到Whatsapp,但现在我想发送一个图像.如何将图像发送到Whatsapp?

我不知道怎么做.

谢谢.

iphone objective-c ios whatsapp

2
推荐指数
1
解决办法
1万
查看次数

如何将位图发送到 WhatsApp 应用程序

我的问题是如何将位图发送到 Whastapp 应用程序,我使用以下代码;

ImageView iv=(ImageView)view.findViewById(R.id.item_image);
Bitmap bitmap = ((BitmapDrawable)iv.getDrawable()).getBitmap();
ByteArrayOutputStream stream = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG, 100, stream);
byte[] byteArray = stream.toByteArray();

PackageInfo info=pm.getPackageInfo("com.whatsapp", PackageManager.GET_META_DATA);
//Check if package exists or not. If not then code
//in catch block will be called
waIntent.setPackage("com.whatsapp");
waIntent.setType("image/png");
waIntent.putExtra(Intent.ACTION_SEND, byteArray);
startActivity(Intent.createChooser(waIntent, "Share with"));
Run Code Online (Sandbox Code Playgroud)

但是那个代码不起作用。我的错误是什么?谢谢。

android bitmap whatsapp

1
推荐指数
1
解决办法
6786
查看次数