嗨,伙计们,
请检查此 Json 的格式 。
{"id": "293369****","owner": {
"name": "******",
"id": "*****"},name": "test event","start_time": "2012-05-18T02:00:00","end_time":"2012-05-18T05:00:00","privacy": "FRIENDS","updated_time": "2012-05-18T08:25:37+0000"}
M using this code for it. M able to fetch all values except owner json array. I want to fetch value of owner array. Kindly suggest me where i am going wrong.
json = new JSONObject(responsedata);
Log.d(TAG, "name=" + responsedata);
facebookData = new Events();
JSONArray data=json.optJSONArray("owner");
Log.d(TAG, "Data length==" + data.length());
if (data.length() > 0) {
for (int i = 0; i < data.length(); i++) {
JSONObject jsonobj = data.getJSONObject(0);
Log.d(TAG, "owner Name="+jsonobj.getString("name"));
}
}
facebookData.setEventName(json.getString("name"));
facebookData.setEventId(json.getString("id"));
facebookData.setEventStartDate(json.getString("start_time"));
facebookData.setEventEndDate(json.getString("end_time"));
facebookData.setPrivacy(json.getString("privacy"));
facebookData.setUpdatedTime("updated_time");
我无法获取所有者姓名和所有者facebook ID。 我的json 笔记本里有些问题 。
请你帮我这个忙
Thanks in Advance Gaurav Gupta