ListView
recycles list items for performance purposes , so in your case its trying to uses the same view for 0,3,6... index.
You need to Override
getViewTypeCount
and return 2 since , you have two different layout.
@Override
public int getViewTypeCount() {
return 2; // return the view type
}
Also , Override
getItemViewType
and return a unique type for position 0
and same type for other position like this.
@Override
public int getItemViewType(int position){
// return a unique number
if(position==0){
return 0;
}
else {
return 1;
}
}