Saturday, July 16, 2011

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

The getView() is called everytime the listview is populating data,
what is meant by this, getView() is called everytime when there is
need views to be recycled. Let's say if you have 20 elements in your
listview, the maximum items visible is 8, the first time you view the
listview, getView() is called 8 times, if you scroll down by x items,
then the getView() will be called x more times. It is normal seeing
getView() called multiple times.


On Jul 16, 9:57 am, juliagrig <iouliag...@gmail.com> wrote:
> Hi all,
>
> I have a listview in my app and a SimpleCursor Adapter in a different
> class. In getView method I tried to  set properties fom the text view
> of each list item.
> It works fine, but I have a log.i(",") message in the end of the
> getView() method and I see that this method run 3 times.
>  So , I see in the logat
>
> 07-16 07:48:58.401: INFO/(341): GetView done
> 07-16 07:48:58.421: INFO/(341): GetView done
> 07-16 07:48:58.541: INFO/(341): GetView done
>
> Why is this happening?
>
> Thanks in advance.

--
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