BaseAdapter view goes into blackhole, why?
The first time getView is called, all is fine. The secon time, vi.getTag() returns null. why is this happening??
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View vi=convertView;
ViewHolder holder;
if( convertView == null ){
vi = inflater.inflate(R.layout.comment_item, null);
ho开发者_Python百科lder=new ViewHolder();
holder.userName = (TextView) vi.findViewById(R.id.comment_username);
holder.comment = (TextView) vi.findViewById(R.id.comment_comment);
holder.img = (RoundedImageView) vi.findViewById(R.id.comment_img);
} else {
holder=(ViewHolder)vi.getTag();
}
You are missing the vi.setTag(holder);
.
精彩评论