简体   繁体   中英

facebook sdk 3.0 photo tags value and key

Bundle params = new Bundle();
String tags = "";
StringBuilder sb = new StringBuilder();
for (int i = 0; i < ischecked.length; i++) {
if (i == 0) {
    sb.append("[");
}
if (ischecked[i]) {
    sb.append("{\"tag_uid\":" + FBFriendlist.get(i).getFBFriendid() + "},");
}
if (i == ischecked.length - 1) {
    sb.replace(sb.length() - 1, sb.length(), "]");
    tags = sb.toString();
}
}
params.putString("tags", tags);

Request requestphoto = new Request(Session.getActiveSession(),"me/photos", params,
                            HttpMethod.POST, new Request.Callback() {

 @Override
 public void onCompleted(Response response) {
     Log.e("id", response.getGraphObject().getProperty("id").toString());
     Intent intent = new Intent(PaintQuitGameScene.this, UserProfileScene.class);
     startActivity(intent);
 finish();
 }
 });

 requestphoto.executeAsync();

When execute, it return nullpointerexception .

What is the format for tags?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM