I've looked around quite a bit but haven't found a real answer to this question. I'm just starting to learn about android adapters and had a few questions. Firstly, do I need to call getView() manually or does it get called automatically? If so, when is it actually called? Lastly, I noticed there's a parameter for "position" with in the list. Is that something I have to increment through iteration or does it get incremented internally somehow?
thanks!
Firstly, do I need to call getView() manually or does it get called automatically?
No, it get called automatically.
If so, when is it actually called?
It will be called when user do something to your ListView
, like when the ListView
displaying a new item when you scrolling it.
Lastly, I noticed there's a parameter for "position" with in the list. Is that something I have to increment through iteration or does it get incremented internally somehow?
No, it will be your list item's position automatically. Its the same for other params like (the default) View convertView
, it will be the View
of current item (row of ListView
).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With