你必须像这样使用 URL
String url = "https://graph.facebook.com/" +facebook_User_name +"/statuses&limit=20&access_token=" + access_token
您必须将该 url 传递给 HttpGet 方法以获取信息。
HttpGet httpget = new HttpGet(url);
HttpResponse response;
try {
response = httpclient.execute(httpget);
HttpEntity entity = response.getEntity();
if (entity != null) {
InputStream instream = entity.getContent();
result= convertStreamToString(instream);
JSONObject json = new JSONObject(result);
JSONArray valArray = json.getJSONArray("data");
for(int i=0;i<valArray.length();i++) {
String info = main_object.getString("message");
}
instream.close();
}
}
catch (ClientProtocolException e) {
e.printStackTrace();
}