All
I am new to Android , If i ask a question in bad manner please inform me so i will take care of that next time.
My Question :
I create Listview , In that list views each row has three elements .
1) ImageView : which display (URL and i convert in Bitmap)
2) Name : Text
3) Address : Text
I successfully created that row but i face one small issue
++++> First when all rows are displayed at that time i am not able to see that Image of every Row . and when i scroll that list then once i can see that images.
help me if any one face this issue.
Code
BaseAdapter class :
@Override
public View getView(int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
holder = null;
LayoutInflater mInflater = (LayoutInflater) context
.getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
if (convertView == null) {
convertView = mInflater.inflate(
R.layout.mention_timeline_listitems, null);
holder = new ViewHolder();
holder.txtTitle = (TextView) convertView.findViewById(R.id.title);
holder.imageView = (ImageView) convertView.findViewById(R.id.icon);
convertView.setTag(holder);
rowItem = (mentionRowItems) getItem(position);
holder.txtTitle.setText(rowItem.getTitle());
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
try {
holder.imageView.setImageBitmap(common
.imageLoad(rowItem.getImageId()));
} catch (Exception ex) {
Log.d("Error------->", ex + "");
}
}
});
thread.start();
} else {
holder = (ViewHolder) convertView.getTag();
}
return convertView;
}
rowFile code
for(loop){ // 4 times
rowItems.add(new mentionRowItems(profile_bg_url, name,
screen_name));
Example .. profile_bg_url = "https://dl.dropboxusercontent.com/u/72783403/AtoZ/1.png";
Example .. screen_name = "Admin"
}
adapter = new mentionBaseAdapter(getActivity(), rowItems);
listView.setAdapter(adapter);
Thanks,
Dharmik