facebook sdk 3.0照片标签价值和关键

时间:2013-01-29 06:58:31

标签: java android facebook facebook-graph-api

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();

执行时,返回nullpointerexception

标签的格式是什么?

1 个答案:

答案 0 :(得分:0)