I have a list view which display multiple kinds of items (Basically
3).
I have overridden all the methods, and it works almost fine.
Basically, For those three types of views, I need to change the
gravity to either left/right or center (Simple TextViews).
This works.
In addition to this, I also have different background images for these
views. I don't understand why it doesn't work. It just picks up one
image and keeps setting it to random items, and for some, I don't even
get a background image.
getItemViewType(int position) - Overridden
getViewTypeCount() - Overridden (Always returns 3)
I was going through the docs, and I found this.
public int getViewTypeCount ()
Returns the number of types of Views that will be created by
getView(int, View, ViewGroup). Each type represents a set of views
that can be converted in getView(int, View, ViewGroup). If the adapter
always returns the same type of View for all items, this method should
return 1.
This method will only be called when when the adapter is set on the
the AdapterView.
Returns
The number of types of Views that will be created by this adapter
What exactly does this "This method will only be called when when the
adapter is set on the the AdapterView." mean?
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en