-2
{Response: responseCode: 200, graphObject: {"id":"108303252910226","first_name":"Chris","last_name":"Jack","email":"[email protected]","gender":"male","birthday":"08\/08\/1984","hometown":{"id":"106377336067638","name":"Bangalore, India"}}, error: null}
我从facebook获取此响应。 如何获得头名Android从Facebook获取数据json
我已经厌倦
try {
String res = response+"";
JSONObject j = new JSONObject(res);
String graphResponse = j.optString("graphObject");
JSONObject j2 = new JSONObject(graphResponse);
String first_name = j2.getString("first_name");
Log.i("firstname", ""+first_name);
}
catch (JSONException e)
{
e.printStackTrace();
}
你到目前为止做了什么?发布代码 –
了解json对象以及如何使用它,http://developer.android.com/intl/zh-tw/reference/org/json/JSONObject.html。 –
这可能对您有所帮助http://stackoverflow.com/questions/30317540/how-do-i-fetch-name-and-email-using-facebook-sdk –