I am aware that you can extend BaseAdapter and override the getViewTypeCount() and getItemViewType(postion) methods and get various row layouts that way.
However, I have just done a tutorial in which ArrayAdapter was extended and getView(int position, View convertView, ViewGroup parent) was the only method overriden.
It seems to me a lot simpler just to follow this approach and use the position maybe with an if/switch to determine the view inflated for a given row.
Is that a correct assumption or are there problems with this approach?
Cheers
no your assumption is wrong. if you need to
inflatedifferentViews the correct way is tooverridegetViewTypeCount()/ getItemViewType(postion)pairs. In this way android will give you a differentconvertViewto inflate based on what thegetViewTypeCount()returns.as stand in the docs:
getViewTypeCount() Returns the number of types of Views that will be created