【发布时间】:2015-06-24 08:59:03
【问题描述】:
如果没有安装 facebook 应用程序,我正在尝试将用户重定向到浏览器以共享我的应用程序中的照片。
我正在使用:
SharePhoto photo = new SharePhoto.Builder()
.setImageUrl(Uri.fromFile(new File(path))
.build();
final SharePhotoContent content = new SharePhotoContent.Builder()
.addPhoto(photo)
.build();
if (ShareDialog.canShow(SharePhotoContent.class)) {
//Sharing via facebook app
shareDialog.show(content);
} else {
//Sharing via browser
Intent shareCaptionIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.facebook.com/userxxxx"));
shareCaptionIntent.setType("image/*");
//set photo
shareCaptionIntent.setData(Uri.fromFile(new File(path)));
shareCaptionIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File(path)));
context.startActivity(Intent.createChooser(shareCaptionIntent, "Share image using"));
}
但是直到现在都没有任何成功。有没有办法分享重定向到 facebook 浏览器页面的内容?
【问题讨论】:
-
我认为浏览器不会获得额外的数据。