It doesn't really make sense for a ListView to have it's height to wrap_content since a ListView allows you to put in more items than will fit on-screen. It can have a height set to a fixed value, e.g. 300px or 200dip, but not wrap_content.
You should never really need to stack lists vertically on-top of or within each other (there are a few exceptions to this, but as a general rule). You should read up more on the ListView component and layout params. Just use different types of list items (a ListView can have many different types of items) and different levels (in theory you could extend ExpandableListView to have as many tiers/levels as you wanted). If you stack ListViews on top of each other (with a fixed height), you'll only be able to fit 5-7 in on a normal device, and each one will only be able to show about one item at a time. What you probably want is an Expandable ListView, with the group items showing the Album/Artist name, and then when these are expanded they will reveal all of the songs in that album. On Jul 23, 6:36 am, sagare <sagar.ekb...@gmail.com> wrote: > Hi Joseph, > thanks for your reply but u mean to say i cant have multiple > ListViews in an activity with height "wrap_content" i think that > should be possile right ? > Also i dont want to have an expanded List i want a have a list of > albums and each album displaying songs without needing for the user to > expand a node also i want a gap / space between 2 albums List. > Please help me with this > > Thanks, > Sagar > > On Jul 22, 11:11 pm, Joseph Earl <joseph.w.e...@gmail.com> wrote: > > > Okay: > > > A ListView must have it's height set to fill_parent - the only way to > > have multiple ListViews in a single activity is to use something like > > Tabs, a ViewFlipper etc, and even then this only really deals with one > > visible ListView at a time (or possibly two horizontally). > > > What you probably want to do is implement a two-tier > > ExpandableListView in a similar fashion to the default Android music > > player (at least on 2.0+) this lets you have a group item for e.g. for > > an album, which when expanded shows all songs in that album. > > > On Jul 22, 4:11 pm, sagare <sagar.ekb...@gmail.com> wrote: > > > > Hi All, > > > I am creating a list of albums and each album can have multiple > > > songs. So I wanted to is having multiple listviews on a screen ok > > > (around 30-35 albums each having their songs) performance wise and > > > wont create a problem ? > > > Or i should implement a single list of albums where each item in > > > the list displays entire contents of that album including its songs? > > > Not sure how much good it is performance wise and from user experience > > > point of view ? Also if i go by this approach would each songs in the > > > album clickable because as far as i know a complete row in a ListView > > > can be clickable and not individual components in a ListRow ? How can > > > i go about implementing this ? > > > > Please let me know the best possible solution to implement this. > > > and the approach for this. > > > > Thanks and regards, > > > Sagar -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en