0
我想上傳我的SD卡文件夾中的所有照片到Facebook相冊。我已經寫下了相同的代碼。是所有圖像文件的列表。但是,程序運行異常。我無法弄清楚原因。這方面的任何投入都是值得歡迎的。從Android(Facebook的SDK 3)上傳多張照片到Facebook
RequestBatch requestBatch = new RequestBatch();
for (final String requestId : fileNames) {
Bitmap image = BitmapFactory.decodeFile(requestId);
Request request = Request.newUploadPhotoRequest(Session.getActiveSession(), image, new Request.Callback() {
@Override
public void onCompleted(Response response) {
showPublishResult("Photo Post ", response.getGraphObject(), response.getError());
}
});
requestBatch.add(request);
}
requestBatch.executeAsync();
}
更新:
它運行到OutOfMemoryException異常。這意味着,sdk正在緩存文件,並因此發生這種情況。有沒有其他方法可以實現,而不是根據請求發送位圖圖像?
你能提供一些參考代碼,這樣我可以得到關於如何上傳多個照片,以及如何創建守護進程的一些想法。 – Scorpion 2013-11-26 08:20:29