I am trying to create a ListView
with a holder, and adding more items on scroll. The problem is, my adapter doesn't recognize the new items as new. I am very confused at this point. What is wrong here?
A simplified version of my adapters getView method:
public View getView(final int position, View convertView, ViewGroup parent) {
final MyHolder holder;
if (convertView == null) {
LayoutInflater li = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = li.inflate(R.layout.empty_item, null);
holder = new MyHolder();
convertView.setTag(holder);
holder.tvTitle = (TextView) convertView.findViewById(R.id.tvTitle);
} else {
holder = (MyHolder) convertView.getTag();
}
return convertView;
}
MyHolder:
class MyHolder {
public TextView tvTitle;
}
So first 3 items goes in the convertview==null
, but rest of them does not. What might be the issue here?