これが尋ねられた可能性があることは知っていますが、具体的な答えを得ることができませんでした。私はjson文字列を持っています:
GraphObject{graphObjectClass=GraphPlace, state={"id":"268367713308665","category":"School","location":{"state":"","zip":"","longitude":32.631482614136,"latitude":0.24519375867929,"country":"Uganda","city":"Kampala","street":"PO BOX 28493"},"category_list":[{"id":"365182493518892","name":"School"}],"name":"Little Wonders Montessori"}}
GraphObject{graphObjectClass=GraphPlace, state={"id":"142442605900768","category":"Education","location":{"state":"","zip":"","longitude":32.606752647018,"latitude":0.28746491511647,"country":"Uganda","city":"Kampala","street":"Heritage\/ Kiwafu Stage, Wheeling Zone, Gaba Road, Kansanga"},"category_list":[{"id":"151676848220295","name":"Education"}],"name":"Wisdomgate Pre-School, Kansanga."}}
近くの場所を照会するときに Facebook から取得しているもので、緯度、経度、カテゴリ、および名前を抽出したいと考えています。これが試していることです
public void onCompleted(List<GraphPlace> places, Response response) {
//Toast.makeText(getActivity(), (CharSequence) places.listIterator(), Toast.LENGTH_LONG).show();
ListIterator<GraphPlace> x = places.listIterator();
while(x.hasNext()){
String f = x.next().toString();
Toast.makeText(getActivity(), f, Toast.LENGTH_LONG).show();
mytext.setText(f);
try {
JSONObject json = new JSONObject(f);
JSONArray array = json.getJSONArray( "GraphPlace" );
Toast.makeText(getActivity(), array.length(), Toast.LENGTH_LONG).show();
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
});
request.executeAsync();
しかしなかなかエントリーポイントが取れず、いくら頑張っても何も出てこないのでよろしくお願いします。