이 같은 JSON 객체했습니다object의 다른 값에 따라 Android에서 JSON 객체를 필터링하는 방법은 무엇입니까?
{
"31": {
"basic": {
"node_id": "31",
"title": "test",
"alias": "test",
"description": "test",
"site_id": "151336557",
"node_type": "7",
"privacy": "7",
"deleted": "0",
"status": "1",
"created_date": "1379169518",
"updated_date": "1379169518",
"created_by": "140513626519686828",
"updated_by": null,
"readable_date": "14th Sep, 2013"
},
"meta": {
"forum_id": "61"
},
"comments": {
"count": 1
},
"likes": {
"count": 0
},
"tags": [],
"node_id": "31"
},
"32": {
"basic": {
"node_id": "32",
"title": "testing discussion",
"alias": "testing-discussion",
"description": "testing",
"site_id": "151336557",
"node_type": "7",
"privacy": "7",
"deleted": "0",
"status": "1",
"created_date": "1379493816",
"updated_date": "1379493816",
"created_by": "140513795022034166",
"updated_by": null,
"readable_date": "18th Sep, 2013"
},
"meta": {
"forum_id": "65"
},
"comments": {
"count": 1
},
"likes": {
"count": 0
},
"tags": [],
"node_id": "32"
}
}
이 내가 특정 개체를 가져하고자하는 코드이다는
JSON 개체 :
arrayTemplist = new ArrayList<FeedItem>();
for(int x=0;x<feedItems.size();x++)
{
int currentNodeType =feedItems.get(x).getNode_type();
if (currentNodeType!=0 && currentNodeType==nodeType)
{
arrayTemplist.add(feedItems.get(x));
Log.d("Cem", arrayTemplist.toString());
}
else{
listAdapter = new FeedListAdapter(this, feedItems);
listView.setAdapter(listAdapter);
listView.setEmptyView(findViewById(R.id.empty));
}
}
listAdapter = new FeedListAdapter(this, arrayTemplist);
listView.setAdapter(listAdapter);
listView.setEmptyView(findViewById(R.id.empty));
}
나는 할 수 없습니다입니다 필터링 된 데이터에 대한보기를 표시합니다. 데이터를 기록 할 수는 있지만 표시 할 수는 없습니다.
전체 코드는 모든 반복 어댑터를 설정 안, 여기에 먼저 http://pastie.org/9662511
실제 질문이 무엇인지 잘 모르겠습니까? –