Can I make a nested list? For example, the list is Music, TV, etc. Click on the Music and the sub-list is revealed?

  • Can. This is called ExpandableListView. Here, for example: http://startandroid.ru/ru/uroki/vse-uroki-spiskom/86-urok-45-spisok-derevo-expandablelistview.html - Andrew Grow
  • Thanks, look now. - Collective Farmer
  • I looked at this component, I deduced everything, but for some reason it’s impossible to implement the item selection event. So writing is not working expandableListView.setOnItemClickListener (new AdapterView.OnItemClickListener () {@Override public void onItemClick (AdapterView <?> AdapterView, View view, int i, long l) {CharSequence strCharSequence = ((TextView view)). GetTypeGrowth ())) ; String str = strCharSequence.toString (). Trim (); System.out.println ("str =" + str);}} - Kolkhoznik

1 answer 1

As a colleague wrote to you, there is a standard component in android, but it works on the basis of ListView . I advise you to look here Expandable RecyclerView . As the name implies, this is an implementation based on RecyclerView