Android ScrollView layout problem

I'm interested in that topic too, so I did a bit of research. First: Never put a ListView in a ScrollView (as you found out yourself). Unfortunately googling this problem doesn't lead to any solutions, so I tried my suggestion from my comment above.

I implemented a custom ListAdapter and put the ListViews into one parent ListView. This doesn't work (leads to the same problem as with a ScrollView). Speaking to the guys on the official android-irc #android-dev on freenode, they told me that putting ListViews into a ListView is as bad as or even worse than putting them into a ScrollView. Unfortunately they also couldn't help me with the problem.

There seems to be only one way to achieve what you want to do; see the answer on this similar question Scrolling with Multiple ListViews for Android . The idea is to merge all ListViews into a single one by a custom adapter and to insert some kind of headers between entries. This is absolutely doable but might require some special effort.


I know it's late to answer this right now, but still - it may be useful to others who arrive here in case of similar problems.

I'd suggest that you use an Expandable ListView for this. It would solve all of your problems. You can have the main/parent names as that of week, and when you expand it, you would have the list of entries for that particular day/week/whatever. Also, you wouldn't have to worry about scrolling as it is taken care by android :)

If you DO try this, then please let me know if this works out for your problem Try searching for examples on Expandable ListView.

edit:check example here - http://mylifewithandroid.blogspot.com/2008/05/expandable-lists.html