android - Download images in async task and show them in ListView -


i've list of urls, each corresponding image.

i need display these images in listview.

currently, approach pass list<string> containing urls customadapter (extending baseadapater).

each row item in listview inflated imageview.

then in getview() method, if currentimageview == null, i'll start asynctask, download bitmap imagelist.get(position).

then in postexecute(), i'll set currentimageview.setbitmap(downloadedbitmap).

in manner,from inside adapter, i'll call asynctask one-by-one each image.

if think, there wrong in approach please let me know. also, please suggest correct approach.

one pitfall approach i've found in when asynctask list element in progress & user scrolls down up, same async task called again.

how can prevent this?

when views recycled, currentimageview not null , keep displaying same images. suggest using universal image loader. takes care of of you, tons of features caching , not.


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -