我有IconicAdapter
扩展ArrayAdapter
:
class IconicAdapter extends ArrayAdapter<String> {
IconicAdapter() {
super(MyService.this, R.layout.activity_listview, R.id.text1, entries);
}
@Override
public View getView(int position,View convertView,ViewGroup parent) {
View row=super.getView(position, convertView, parent);
ImageView icon=(ImageView)row.findViewById(R.id.img1);
icon.setImageResource(R.drawable.ic_launcher);
return(row);
}
}
当我使用add方法时,它添加了两次:
IconicAdapter ia=new IconicAdapter();
lv.setAdapter(ia);
ia.add("1000");
有什么理由这样吗?