如何在发布时向图像添加说明

时间:2012-06-18 05:03:06

标签: android facebook-graph-api

我应该在代码中添加什么内容,以便为图像添加说明

Bitmap bi = BitmapFactory.decodeFile("/sdcard/viewitems.png");

ByteArrayOutputStream baos = new ByteArrayOutputStream();
bi.compress(Bitmap.CompressFormat.JPEG, 100, baos);
data = baos.toByteArray();

Bundle params = new Bundle();
params.putString(Facebook.TOKEN, facebook.getAccessToken());
params.putString("method", "photos.upload");
params.putByteArray("picture", data);

AsyncFacebookRunner mAsyncRunner = new AsyncFacebookRunner(facebook);
mAsyncRunner.request(null, params, "POST", new SampleUploadListener(), null);

1 个答案:

答案 0 :(得分:1)

添加以下行

params.putString("caption", "your Caption message goes here");
params.putString("description", "your Description text goes here");

因此,键表示参数类型,该值为您提供实际消息。