android listview 数据错乱,android 关于ListView Item数据混乱问题

@Override

public View getView(int position, View convertView, ViewGroup

parent)

{

ViewHodler hodler = null;

String oTid =null;

String oSubject = null;

String oAuthor = null;

String oDateline = null;

String oReplies = null;

String odateStr = null;

String oAuthorphoto=null;

try

{

ExtJSONObject oDigestItem  =

mForumJsonArray.getExtJSONObject(position);

oTid = oDigestItem.getString("tid");

oSubject = oDigestItem.getString("subject");

oAuthor = oDigestItem.getString("author");

oDateline =oDigestItem.getString("dateline");

odateStr = AppUtility.formatRelativeTime(Integer

.parseInt(oDateline));

Log.i("TAG", "date= " + oDateline);

oReplies = oDigestItem.getString("replies");

oAuthorphoto=oDigestItem.getString("authorid");

}

catch (JSONException e)

{

e.printStackTrace();

}

if (convertView == null)

{

LayoutInflater inflater = getLayoutInflater();

convertView =

inflater.inflate(R.layout.m_digesttopiclist_item,

null);

hodler = new ViewHodler();

hodler.t_Subject = (TextView) convertView

.findViewById(R.m_digesttopicid.subject);

hodler.t_Author = (TextView) convertView

.findViewById(R.m_digesttopicid.author);

hodler.t_Dateline = (TextView) convertView

.findViewById(R.m_digesttopicid.dateline);

hodler.t_photo = (ImageView) convertView

.findViewById(R.m_digesttopicid.userimage);

hodler.t_Replies = (TextView) convertView

.findViewById(R.m_digesttopicid.replies);

hodler.t_photo.setTag(oAuthorphoto);

convertView.setTag(hodler);

}else {

hodler = (ViewHodler) convertView.getTag();

resetViewHolder(hodler);

}

hodler.t_Subject.setText(oSubject);

hodler.t_Dateline.setText(odateStr);

hodler.t_Author.setText(oAuthor);

hodler.t_Replies.setText(oReplies);

hodler.t_Replies.setGravity(Gravity.CENTER);

hodler.t_photo.setTag(oTid);

String

userFaceUrl=AppUtility.getResourceString(R.string.apiuserphotourl)+"uid="+oAuthorphoto+"&size=middle";

this.setImageValue(hodler.t_photo,oTid,userFaceUrl,100,

100, R.drawable.m_newestlistimage,-1);

return convertView;

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值