Using Mergeadapter; Looking For A Way To Determine A List Item's Data Type In The Listactivity Onlistitemclicked Method
I'm using the MergeAdapter to create a sectioned list where each section of the list contains a different type of underlying data. All is working pretty much as expected. However
Solution 1:
I'm using the MergeAdapter to create a sectioned list where each section of the list contains a different type of underlying data.
As the MergeAdapter
project page notes, "If you have questions regarding the use of this code, please join and ask them on the cw-android Google Group".
Fortunately for you, I saw your question here.
This is the case because I can't find a good way to determine the type of object that underlies the selected item unless I keep a separate map of list position to object type.
Call getItem()
on the MergeAdapter
to get the actual object, then use instanceof
or use interfaces or something to find an appropriate type to use on the object itself.
Post a Comment for "Using Mergeadapter; Looking For A Way To Determine A List Item's Data Type In The Listactivity Onlistitemclicked Method"