3

I have in integer array in which I have images from drawable folder. Now I want to share image from that integer array to facebook wall.I tried the code below

    Uri imageuri  = Uri.parse("android.resource://" + "package name/" + mBitmapIds[int_image_position]);
    String filePath = imageuri.getEncodedPath();
    Bundle bundle=new Bundle();
    bundle.putString("picture", filePath);
    facebookConnector.getFacebook().request("me/feed", bundle, "POST");

where mBitmapIds is int array but it is not posting the image on wall. can anybody tell me how can I do that. Thanks in advance.

rahul
  • 2,563
  • 8
  • 29
  • 54

1 Answers1

2

Try to use AsyncFacebookRunner.

Bundle bundle = new Bundle();
bundle.putString("message", "picture caption");
bundle.putByteArray("picture", ImageBytes);
mAsyncRunner.request("me/photos", param, "POST", new SampleUploadListener());

Kindly refer Android post picture to Facebook wall too.

I hope this will help you.

Community
  • 1
  • 1
Gunaseelan
  • 12,697
  • 10
  • 74
  • 118