分享Intent Android的Instagram选项

时间:2012-07-03 10:04:45

标签: android instagram

我正在开发一个将在不同社交网站上分享内容的应用程序。 问题是我无法在共享意图中看到Instagram选项。我可以看到蓝牙,邮件,消息等,但无法看到Instagram。我的设备上安装了Instagram应用程序。 谁能告诉我这是什么问题?

其次有没有办法自定义分享意图中的选项?就像我想要从中排除消息。有可能吗?

2 个答案:

答案 0 :(得分:6)

您好,我正在向Instagram发送图片:

Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(MediaStore.Images.Media
.insertImage(getContentResolver(), source, title, description)));
shareIntent.setType("image/jpeg");
startActivity(Intent.createChooser(shareIntent,
getResources().getString(R.string.send_to)));

这只回答了问题的第一部分。

答案 1 :(得分:2)

如果你想在Instagram上分享图像,那么你不需要使用Intent.createChooser,你可以使用

   shareIntent.setPackage("com.instagram.android");