Saturday, July 16, 2011

Re: [android-developers] Re: List View and Simple Cursor Adapter

It's called as many times as ListView sees fit.

FWIW, I've also seen getView called more times than the number of
visible list items (about 2X the number).

Don't worry about it - just make sure your getView does the right thing,
based on the item's "position".

Also don't assume a one to one mapping between items and their views.
Specifically, don't try to create some kind of secondary data structure
back-mapping the items to their respective views.

-- Kostya

16.07.2011 22:29, ΙΟΥΛΙΑ ΓΡΗΓΟΡΙΑΔΟΥ пишет:
> Ok Thanks for the explanation,
> but when I start the app , for example I have 1 list item,(with 2
> textviews, a button and an imageview in the list_item.xml) I see that
> the getView() is called 3 times.
>
> ...?
>
> Thank you!
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

--
Kostya Vasilyev

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment