摘要:
没什么好说的,注意bindView和newView就行。 1 public class MySimpleCursorAdapter extends CursorAdapter { 2 private LayoutInflater mInflater; 3 4 public MySimpleCursorAdapter(Context context, Cursor c) { 5 super(context, c, false); 6 mInflater = LayoutInflater.from(context); 7 } 8 9 ... 阅读全文
摘要:
今天看了下Android 的ArrayAdapter源代码,它继承了BaseAdapter,代码加上注释有500多行。于是,我精简了下,自己写个了最简单的供大家理解。 1 public class MyArrayAdapter<T> extends BaseAdapter { 2 private List<T> mObjects; 3 private int mResource; 4 private LayoutInflater mInflater; 5 6 public MyArrayAdapter(Context context, int layout... 阅读全文