如何将图像从移动SD卡发布到Facebook [英] how to post image from mobile sdcard to Facebook

查看:98
本文介绍了如何将图像从移动SD卡发布到Facebook的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经实现了一小段代码,可以从网址发布标题,描述和图片。但是如何从SD卡中选择图像并允许用户将图像发布到Facebook



我使用的代码如下。



此代码从另一个网址获取图像。

I've implemented a small piece of code that can post title, description, image from a url. But how do i select an image from sd card and allow user to post the image to facebook

The code that i used is as follows.

This code takes imageurl from another url.

shareDialog = new ShareDialog(MainActivity.this);
               if (ShareDialog.canShow(ShareLinkContent.class)) {
                   ShareLinkContent linkContent = new ShareLinkContent.Builder()
                           .setContentTitle("Hello")
                           .setContentDescription(
                                   "sample")
                           .setContentUrl(Uri.parse("http://abc.com/"))
                           .setImageUrl(Uri.parse("http://s3-ak.buzzfed.com/static/images/public/verticals/food-title.png?v=201504021353"))
                           .build();

                   shareDialog.show(linkContent);





我还实现了一个代码,用户可以从库中选择图像并获取图像名称和路径。现在我如何将此图像参数传递给ShareLinkContent



I also implemented a code where user can select image from gallery and get the image name and path. Now how do i pass this image parameter to ShareLinkContent

推荐答案

请参阅在Android上处理输入和存储 [ ^ ]。


这篇关于如何将图像从移动SD卡发布到Facebook的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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