1. Implement BaseAdapter
I think your best bet is to extend BaseAdapter and implement the following methods:
getCount()
getItem(int)
getItemId(int)
getView(int, View, ViewGroup)
It would look something like this:
public class MyAdapter extends BaseAdapter() {
private List<Map<Contact, Name>> map;
private Context context;
public MyAdapter(List<Map<Contact, Name>> map>, Context context) {
this.map = map;
this.context = context;
}
public int getCount() {
return map.size(); // or do you want one list item per name?
// if so, just count out all the map entries in each item of the list
}
public int getItemId(int position) {
return position; // doesn't matter too much...
}
public View getView(int position, View convertView, ViewGroup parent) {
// populate the view here...
// use LayoutInflater.from(context).inflate(resource, parent, false) to inflate new views
}
}
2. Be scrupulous about using the ViewHolder pattern
When implementing getView(), utilizing this design pattern will save a LOT of memory:
http://www.screaming-penguin.com/node/7767