リスト アダプターは、json ファイルの解析後に作成されます。コンテンツは問題ありませんが、リストには同一の要素 (最後の要素) しかありません。何が間違っている可能性がありますか?
主な活動:
CatalogAdapter catAdapter;
catAdapter = new CatalogAdapter(this, events);
setListAdapter(catAdapter);
カタログ アダプタ:
CatalogAdapter(Context context, ArrayList<ListData> _events) {
cont = context;
events = _events;
lInflater = (LayoutInflater) cont.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
public int getCount() {
return events.size();
}
public ListData getItem(int position) {
return events.get(position);
}
public long getItemId(int position) {
return position;
}
public View getView(int position, View convertView, ViewGroup parent) {
View view = convertView;
if (view == null) {
view = lInflater.inflate(R.layout.inetlist, parent, false);
}
ListData p = getItem(position);
((TextView) view.findViewById(R.id.title)).setText(p.title);
((TextView) view.findViewById(R.id.decription)).setText("Описание: \n"+p.description);
return view;
}