开发者

Doubts with base adapter class and its functionality

I am trying for the customized list view,

I am adding the list of objects using array list and i send it to the class that extends base adapter and when i extends the base adapter class,it implements some methods such as getView etc.

and in the getView i am sending it to the class which assign the names(datas) to customized menu which is in XML

what i want to know is that ,suppose i have a collection of 5 objects and does the getView get called for 5 Objects?

开发者_StackOverflow社区

Am i making it clear to you.

Regards

Rakesh Shankar.P


Adapter#getView is only called when the AdapterView requires a view. You should not make any assumptions about how frequently or how many times getView is called. The only thing getView should do is return the required view as quickly as possible.


I placed a Log.d() in the getView() and noticed that getView() has been called 5 times.
i.e. getView() is called for 5objects and therefore 5 Views are created.

And this tutorial says if you have a billion items ,instead of billion Views are get created - views will be cached according to the size of the window.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜