{Response: responseCode: 200, graphObject: {"id":"108303252910226","first_name":"Chris","last_name":"Jack","email":"adaptech123@gmail.com","gender":"male","birthday":"08\/08\/1984","hometown":{"id":"106377336067638","name":"Bangalore, India"}}, error: null}
I'm getting this response from facebook. how to get the first name
I have tired
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();
}