java - when wouldn't i want to nullify every list item when using adapter? -


i'm using image adapter fill android listview.

i know adapter recycles items in listview.

but if need nullify every view in each item in list,

what's benefit anyway in recycling items?a 

i mean, when wouldn't want nullify every list item?

i have tried nullify every view in item have thought - what's point in recycling anyway , how can avoid tedious nullifying.

adding:

my problem when change image view in first item's layout

i scroll down , see image has changed in 4th , 8th items.

it gives changed image instead of default one.

i can overcome putting defualt image everytime (appears in layout xml anyway)

but think: have on evry single view in item's layout?

why not defaults xml?

the listview recycles views contained in list. views merely visual representations of data provided adapter gives it. listview absolutely nothing actual data showing. don't have nullify anything.

the reason happens in listviews, list items same (usually). when list item goes out of sight, listview take view , give adapter. adapter fill view appropriate data , give listview. listview stick bottom (or top) of visible part of list. cuts down on overhead of inflating new views. limits memory usage of keeping view objects in memory. makes overall smoother scroll.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

inno setup - TLabel or TNewStaticText - change .Font.Style on Focus like Cursor changes with .Cursor -