Getjsonarray() In Graphresponse Cannot Be Applied To Java.lang.string - Facebook
i have develop a android application integrate with facebook login now i want to make facebook app invite function(invitable_friends api) but in my code i got red underline errors.
Solution 1:
From here (https://developers.facebook.com/docs/reference/android/current/class/GraphResponse/) I can see that getJSONObject()
and getJSONArray()
do not have parameters at all. You should retrieve the object respective the array from the GraphResponse
using this methods and once you have a JsonObject
or JsonArray
you can access specific fields.
response.getJSONArray()
will give you an object of type JSONArray
and response.getJSONObject()
will give you an object of type JSONObject
. Using this objects you can access the fields using jsonObject.getString("user_id")
or similar (see docs.oracle.com/javaee/7/api/javax/json/JsonObject.html)
Post a Comment for "Getjsonarray() In Graphresponse Cannot Be Applied To Java.lang.string - Facebook"