2012-10-26 20 views
2

我使用FB API 3.0的Android,並根據會話的例子,我用Facebook API 3.0。 - 添加包信息圖片上傳

Request request = Request.newUploadPhotoRequest(Session.getActiveSession(), image, new Request.Callback(); 

上傳圖片。 我需要添加一些默認文本到這個圖像,但我無法弄清楚把它放在哪裏。

在舊的API有已發送的參數捆綁:

params.putByteArray("picture", imgData); 
params.putString(Facebook.TOKEN, accessToken); 
params.putString("caption", MyGlobals.INSTANCE.activeSetting.f_name); 

什麼是添加文本要求對newUploadPhotoRequest的正確方法?

tnx。

回答

7

後創建的請求,並在執行它之前,你可以做到以下幾點:

// Get the current parameters for the request 
Bundle params = request.getParameters(); 
// Add the parameters you want, the caption in this case 
params.putString("name", "My Caption String"); 
// Update the request parameters 
request.setParameters(params); 

// Execute the request 
Request.executeBatchAsync(request); 
+0

是的!這與所描述的完全相同! Tnx C.Abernathy !! – Balkyto

1

通過上述解決方案,我們無法描述添加到圖像。

解決方案:

params.putString("name", "My Caption String"); 

putString第一個參數是鍵My caption String該密鑰是唯一的一個獨特取作message

message由於替換name