I am using setViewValue method of ShowViewBinder to access image
inside row of listView.
The idea is to load image from internet and display it inside row of
listView.
To load image, I am starting new image loader thread, but what I
discovered when debugging this code, for each row I am actually
starting 3 or 4 threads. I don't understand why. The code in if
(columnIndex == ...) is executing more than once.
What I am doing wrong. Should I take another approach?
Thanks.
My code goes something like this:
class ShowViewBinder implements SimpleCursorAdapter.ViewBinder {
//@Override
public boolean setViewValue(View view, Cursor cursor, int
columnIndex) {
Thread t;
if (columnIndex ==
cursor.getColumnIndex(DbAdapter.KEY_SPEAKER_IMAGE)) {
final ImageView iv = (ImageView) view;
final String filePath =
cursor.getString(cursor.getColumnIndexOrThrow(DbAdapter.KEY_SPEAKER_IMAGE));
//makeToast(filePath);
t = new Thread() {
public void run() {
//viewImage();
common.getRemoteImage(filePath, handler, iv);
Log.d("Speaker List - Loading Image", filePath);
}
};
t.start();
return true;
}
..... etc
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en