2011-10-11 97 views
0

我無法直接上傳照片到牆上。 請參閱下面的代碼。它將消息發佈到牆上,但照片未上傳,並且我沒有收到任何錯誤消息。將照片上傳到Facebook的壁上android

Bundle parameters = new Bundle();     
parameters.putByteArray("picture", imgData); 
parameters.putString("message", "This is facebook post"); 
response = facebook.request("me/feed", parameters,"POST"); 

如果我使用「我/照片」它上傳照片到相冊。 感謝 MO

回答

0

試試這個代碼,它似乎很好地工作,我....

Bitmap imagewall = BitmapFactory.decodeFile(path));

ByteArrayOutputStream stream = new ByteArrayOutputStream();

imagewall.compress(Bitmap.CompressFormat.JPEG, 100, stream);

byte[] bitmapdata = stream.toByteArray(); bundle.putByteArray("picture", bitmapdata);

+1

都能跟得上它是沒有不工作。同樣的問題,消息正在發佈,但圖像沒有出現。 – Moswal