1.私はあなたの最善の策は、BaseAdapterを拡張して実装することだと思いますBaseAdapter
を実装次の方法:
getCount()
getItem(int)
getItemId(int)
getView(int, View, ViewGroup)
これは次のようになります。
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)(getViewメソッドを実装する場合ViewHolderパターンに
の使用について綿密て、このデザインパターンを利用して大量のメモリを節約します:
http://www.screaming-penguin.com/node/7767
を使用してください。CursorAdapter – Shaireen