开发者

Contract between Adapter and AdapterView

开发者 https://www.devze.com 2023-01-11 03:53 出处:网络
Is there some place which describes the contract between Adapter and AdapterView, or between ListView and ListViewAdapter.

Is there some place which describes the contract between Adapter and AdapterView, or between ListView and ListViewAdapter.

I'm trying to create my own ListView Adapter. It is not clear to me the sequence of method invocations nor who maybe calling these methods.

There appear to be several overlapping methods.

  • getItem returns a data object, but you don't know the type.
  • getItemViewType returns an integer. Who determines the integer? Are they defined somewhere? Userdefined?
  • getView

getView seems to be the only one that really matters. What other code maybe involved that would try to do something with the returned 开发者_StackOverflow社区data and returned view? How can this other code know how to assign the data to the view if the type of neither is known?

A general explanation of the design would be helpful.


I think you will have to look into android source code :
http://www.google.co.in/codesearch/p?hl=fr#uX1GffpyOZk/core/java/android/widget/AdapterView.java&q=adapterView&sa=N&cd=1&ct=rc

0

精彩评论

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