开发者

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);.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜