1

I could not figure out how to implement two basic functionalities with the expandable lists: 1. The onClick for the child 2. Using linear layout for the children, so that I can have multiple clickable items in same row under the parent item

Can somebody help me with some sample code for the above?

user395482
  • 11
  • 2
  • 4

1 Answers1

0

If someone is still interested - the google guys have written some very good samples for understanding and using expanable lists!

You can either use ExpandableListView (which extends ListView class), or simply create an ExpandableListActivity, which hosts an ExpandableListView.

Just take a look at these three examples. I made screenshots to show what it looks like (only notice that the background color isn't the one from the default theme):

Example 1 - ExpandableList which receives data from a custom ExpandableListAdapter

alt text

Example 2 - ExpandableList which receives data from a CursorAdapter

(no pic)

Example 3 - ExpandableList which receives data from a simple HashMap-based Adapter

alt text

cody
  • 6,389
  • 15
  • 52
  • 77