Reputation: 17
I need an example in Java (Android) to post two photos and a text in a single post using AsyncFacebookRunner.
Upvotes: 0
Views: 140
Reputation: 17
private void sendPhoto(String status) {
for (int i = 0; i < caminhoImagens.size(); i++) {
EnviaPhoto(status, caminhoImagens.get(i), i);
}
}
}
private void EnviaPhoto(String status, String camImg, int i) {
// TODO Auto-generated method stub
Bitmap yourSelectedImage = BitmapFactory.decodeFile(Environment.getExternalStorageDirectory() + camImg);
image = yourSelectedImage;
AsyncFacebookRunner runner = new AsyncFacebookRunner(facebook);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
image.compress(Bitmap.CompressFormat.PNG, 100, baos);
byte[] bytes = baos.toByteArray();
Bundle params = new Bundle();
params.putByteArray("picture", bytes);
params.putString("message", status);
if (i != 0){
corpo = "";
}
runner.request("me/photos", params, "POST", requestListener, null);
}
Upvotes: 1