Here is my confusion: I hava a listview with 8 same items.I add one by one by add button..And it will new 8 convertView at first.Totally, I add 15 items.But when I scrolled down when the 11th item turned up, it new a convertView once again..Why it don't just use the convertView from the recycler?
Here are parts of the codes:
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
if (convertView == null) {
LayoutInflater layoutInflater = (LayoutInflater)this.mcontext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = layoutInflater.inflate(R.layout.city_item, parent, false);
viewHolder = new ViewHolder();
Log.d("test", "new one" + position);
viewHolder.checkBox = (CheckBox)convertView.findViewById(R.id.checkbox);
viewHolder.textView = (TextView)convertView.findViewById(R.id.tv_city);
convertView.setTag(viewHolder);
} else {
viewHolder = (ViewHolder)convertView.getTag();
}
}
Here are the pics: