【发布时间】:2013-11-25 07:11:01
【问题描述】:
我使用了一个简单的共享意图来共享存储在 sd 卡上的图像。它目前向我显示了在我的电子邮件和谷歌驱动器上共享的选项。但无法在 facebook、twitter 或任何其他社交网站上分享。
以下是我用于分享意图的代码:
// Populate the share intent with data
Uri uri = Uri.fromFile(new File(Environment.getExternalStorageDirectory()
+ File.separator + folderName + File.separator +mImageTitles.get(position)));
// Setting up the share intent
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.setType("img/*");
shareIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
shareIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
shareIntent.putExtra(Intent.EXTRA_TEXT, mImageTitles.get(position));
shareIntent.putExtra(Intent.EXTRA_STREAM, uri);
【问题讨论】:
标签: android facebook android-intent share