Click here to Skip to main content
15,898,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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.
Java
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);


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
Posted

1 solution

See the Storage sections in Handling Input and Storage on Android[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900