我正在使用 facebook sdk 并尝试修改父函数中的变量(至少我会这么称呼它)。
如何修改变量“actor”(标记)?
public void getUserFeed(int limit) {
String q = ""; // query taken out
Bundle params = new Bundle();
params.putString("q", q);
Session session = Session.getActiveSession();
Request request = new Request(session,
"/fql",
params,
HttpMethod.GET,
new Request.Callback(){
public void onCompleted(Response response) {
GraphObject graphObject = response.getGraphObject();
if (graphObject != null) {
JSONObject jsonObject = graphObject.getInnerJSONObject();
try {
JSONArray array = jsonObject.getJSONArray("data");
for (int i = 0; i < array.length(); i++) {
String q = "" // query taken out
Bundle params = new Bundle();
params.putString("q", q);
String actor = ""; // Trying to access this variable *******
Session session = Session.getActiveSession();
Request request2 = new Request(session,
"/fql",
params,
HttpMethod.GET,
new Request.Callback(){
public void onCompleted(Response response) {
GraphObject graphObject = response.getGraphObject();
//String s = textViewResults.getText().toString();
if (graphObject != null) {
JSONObject jsonObject = graphObject.getInnerJSONObject();
try {
JSONArray array = jsonObject.getJSONArray("data");
for (int i = 0; i < array.length(); i++) {
JSONObject object = (JSONObject) array.get(i);
actor = object.getString("name"); // Trying to access "actor" here *******
}
} catch (JSONException e) {
e.printStackTrace();
}
}
}
});
}
}
}
}
}
);
}