package com.example.xmltestapp; import java.util.ArrayList; import android.app.Activity; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.TextView; public class XMLData extends BaseAdapter { private Activity activity; private ArrayList data; public XMLData(Activity activity) { super(); this.activity = activity; this.data = new ArrayList(); } public void add(String item) { data.add(item); } @Override public int getCount() { return data.size(); } @Override public Object getItem(int position) { return data.get(position); } @Override public long getItemId(int position) { return 0; } @Override public View getView(int position, View convertView, ViewGroup parent) { if (convertView == null) convertView = new TextView(activity); ((TextView)convertView).setText(data.get(position)); return convertView; } }