user991429
user991429

Reputation: 322

n level Expandable Listview

How to display n- level of expandable list view android, I am getting only examples for 3-Levels expandable.

Referring this :link

Please guideline or share me suitable example for Multi-level expandable display in android.

Thanks,

Upvotes: 9

Views: 11087

Answers (1)

Md Abdul Gafur
Md Abdul Gafur

Reputation: 6201

According to this example.

   public View getChildView(int groupPosition, int childPosition,

                   boolean isLastChild, View convertView, ViewGroup parent) {

             CustExpListview SecondLevelexplv = new CustExpListview(Vincent_ThreeelevellistActivity.this);

             SecondLevelexplv.setAdapter(new SecondLevelAdapter());

             SecondLevelexplv.setGroupIndicator(null);

             return SecondLevelexplv;

      }

Here the getChildView method creates a new adapter by CustExpListview Class and sets is as an Adapter.
The same way you can create a new BaseExpandableListAdapter Class and set it in CustExpListview Class getChildView method.

Upvotes: 9

Related Questions