Henrique
Henrique

Reputation: 5011

Upload a picture to Facebook with a caption using Facebook SDK in Android

I'm correctly posting a photo to my default album using the code below. Is there a way to add a comment/caption to that photo? Thanks.

Bitmap sourceBitmap = BitmapFactory.decodeFile(bitmapPath);
                    Request request = Request.newUploadPhotoRequest(session, sourceBitmap, new Callback() {

                        @Override
                        public void onCompleted(Response response) {
                        }
                    });
                    request.executeAsync();

Upvotes: 2

Views: 1543

Answers (1)

Ming Li
Ming Li

Reputation: 15662

Do something like:

Request request = Request.newUploadPhotoRequest(session, sourceBitmap, new Callback() {...});
Bundle params = request.getParameters();
params.putString("message", "Your Caption Here");
request.setParameters(params);
request.executeAsync();

Upvotes: 5

Related Questions