@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;
}