I use in the getView()-Method of this example a static function to download the source of an ImageView. Later there will be threading included. However, I like to know in general how save the use of static function is in this case.
Because I experienced, that in some cases (when I scroll really fast) the Images get mixed up.
/**
* Is called, when the ListAdapter requests a new ListItem, when scrolling. Returns a listItem (row)
*/
public View getView(int position, View convertView, ViewGroup parent) {
View v = convertView;
if (v == null) {
LayoutInflater vi = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate(R.layout.row, null);
}
Order o = items.get(position);
if (o != null) {
TextView tt = (TextView) v.findViewById(R.id.toptext);
if (tt != null) {
tt.setText("Name: "+o.getOrderName()); }
//At this point I use a static function to download the bitmap to set it as source of an ImageView
}
return v;
}