Android的共享照片和文字一起使用ShareOpenGraphObject [英] Android Sharing Photo and Text together using ShareOpenGraphObject

查看:2077
本文介绍了Android的共享照片和文字一起使用ShareOpenGraphObject的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想张贴图片和文字一起深入我的Andr​​oid应用程序,但似乎禁用后链接共享对话框,甚至错误几秒钟后,窗口消失本身:无法生成用户preVIEW ..不对劲在我的code?

  SharePhoto照片1 =新SharePhoto.Builder()
                .setBitmap(BI)
                .setImageUrl(Uri.parse(recUrl))
                。建立();        ShareOpenGraphObject对象=新ShareOpenGraphObject.Builder()
                .putString(OG:类型,healthsynergy.photo)
                .putString(OG:称号,食品)
                .putString(OG:描述,这是一个美妙的食物。)
                .putPhoto(OG:形象,照片1)
                。建立();
        ShareOpenGraphAction行动=新ShareOpenGraphAction.Builder()
                .setActionType(healthsynergy.publish_actions)
                .putObject(照片对象)
                。建立();
        ShareOpenGraphContent内容1 =新ShareOpenGraphContent.Builder()
                .SET previewPropertyName(照片)
                .setAction(动作)
                。建立();
        shareDialog.show(内容1);


解决方案

看来,这是不可以张贴OG行动没有形象的设置,即使你有共同目标的图像。

I am trying to post image and text together thorough my android app but the share dialog appears with post link disabled and even the window disappears itself after few seconds with error: Failed to generate preview for user.. something wrong in my code?

SharePhoto photo1 = new SharePhoto.Builder()
                .setBitmap(bi)
                .setImageUrl(Uri.parse(recUrl))
                .build();

        ShareOpenGraphObject object = new ShareOpenGraphObject.Builder()
                .putString("og:type", "healthsynergy.photo")
                .putString("og:title", "food")
                .putString("og:description", "This is a wonderful food.")
                .putPhoto("og:image",photo1)
                .build();


        ShareOpenGraphAction action = new ShareOpenGraphAction.Builder()
                .setActionType("healthsynergy.publish_actions")
                .putObject("photo", object)
                .build();
        ShareOpenGraphContent content1 = new ShareOpenGraphContent.Builder()
                .setPreviewPropertyName("photo")
                .setAction(action)
                .build();


        shareDialog.show(content1);

解决方案

Seems it is not possible to post OG action without "image" set, even if you have images in shared object.

这篇关于Android的共享照片和文字一起使用ShareOpenGraphObject的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆