android nested listview

I had the same problem today, so this is what I did to solve it:

I have a ListView, with a CustomAdapter, and on the getView of the customAdapter, I have something like this:

LinearLayout list = (LinearLayout) myView.findViewById(R.id.list_musics);
list.removeAllViews();

for (Music music : albums.get(position).musics) {
    View line = li.inflate(R.layout.inside_row, null);

    /* nested list's stuff */

    list.addView(line);
}

So, resuming, It’s not possible to nest to ListViews, but you can create a list inside a row using LinearLayout and populating it with code.

Leave a Comment