ArrayAdapter是从BaseAdapter派生出来的,具备BaseAdapter的所有功能,但ArrayAdapter更为强大,它实例化时可以直接使用泛型构造,我们在Android SDK中可以看到android.widget.ArrayAdapter
通过Adapter我们构造一个支持icon的item,下面我们在getView中使用的是imageView显示图片,当然android123提示大家其实TextView也可以直接绑定一个drawable对象显示的,void setCompoundDrawables(Drawable left, Drawable top, Drawable right, Drawable bottom) 或void setCompoundDrawablesWithIntrinsicBounds(int left, int top, int right, int bottom) 和void setCompoundDrawablesWithIntrinsicBounds(Drawable left, Drawable top, Drawable right, Drawable bottom) 即可,其中第二种的int类型指定的资源id,方位则是textview什么位置显示drawable对象
public ArrayAdapter( int resource, int textViewResourceId)一般用的是这个,前者是布局样式,后者是数据源,比如数组什么的