I'm trying to create a list with headers above a grouping of items. I was looking at SeperatedListAdapter available here: http://jsharkey.org/blog/2008/08/18/separating-lists-with-headers-in-android-09/ but I ran into an error (ERROR/AndroidRuntime(2025):
java.lang.IllegalStateException: ArrayAdapter requires the resource ID to be a TextView
)
Now I'm looking into more o开发者_如何学JAVAptions including making a new one. Do you guys have any hints?
Thanks, Bryon
AFAIK, Mr. Sharkey's code works just fine. You may be using the wrong ArrayAdapter
constructor.
You can also use my MergeAdapter
to achieve the same ends.
That's how I solved the sectioning in ListViews with an ArrayAdapter http://bartinger.at/listview-with-sectionsseparators/
We have this same problem and have found the following two projects that meet our needs:
- StickyListHeaders
- StickyGridHeaders
精彩评论