Edu*_*aes 2 sdk android facebook
我正在使用Eclipse/Android - Facebook SDK,我需要在相同的请求上传文本照片.SDK中有一个示例,但它发布没有任何文本的照片来解释图片.
有谁知道怎么做?
Edu*_*aes 10
我在一周内编写了android和facebook sdk编程,因为没有人回答我的问题并且包括对我的帖子进行投票我自己解决了SDK限制并添加了一个方法来实现带有标题的ulpload照片.吼道解决方案:
将此代码插入com.facebook - > request.java
public static Request newMyUploadPhotoRequest(Session session, Bitmap image, String caption,String description,
Callback callback) {
Bundle parameters = new Bundle(3);
parameters.putParcelable(PICTURE_PARAM, image);
parameters.putString("caption",caption);
parameters.putString("description",description );
return new Request(session, MY_PHOTOS, parameters, HttpMethod.POST, callback);
}
Run Code Online (Sandbox Code Playgroud)
从您的活动中调用方法
Bitmap image = BitmapFactory.decodeFile(picturePath);
Request request = Request.newMyUploadPhotoRequest(Session.getActiveSession(), image,"Teste Caption", "teste description", new Request.Callback() {
@Override
public void onCompleted(Response response) {
showPublishResult(getString(R.string.photo_post), response.getGraphObject(), response.getError());
}
});
Request.executeBatchAsync(request);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2559 次 |
| 最近记录: |