@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewTag viewTag;
if(convertView == null) {
convertView = myInflater.inflate(R.layout.row_item, null);
viewTag = new ViewTag((LinearLayout)convertView.findViewById(R.id.row), (TextView)convertView.findViewById(R.id.tv));
convertView.setTag(viewTag);
}
else {
viewTag = (ViewTag) convertView.getTag();
}
viewTag.tv.setText(lvt.getTextAt(position));
viewTag.tv.setVisibility(View.VISIBLE);
boolean show = lvt.getShowAt(position);
if(show) {
viewTag.tv.setVisibility(View.GONE);
viewTag.ll.setVisibility(View.GONE);
}
else {
viewTag.ll.setVisibility(View.VISIBLE);
}
return convertView;
}
I use above code in BaseAdapter to show list view.
lvt is an application global data.
If show is true, I want to disappear the cell.
But not delete the data.
But my method will not show data, but show the divider line.
How can I do it?