SHARE
TWEET

Untitled

a guest Jul 21st, 2013 781 Never
  1.  ExpandableListView elv = (ExpandableListView)findViewById(R.id.expandableListView_categories);
  2.        
  3.         ArrayList<Category> categories3 = new ArrayList<Category>();
  4.         categories3.add(new Category("__cat1"));
  5.         categories3.add(new Category("__cat2"));
  6.         categories3.add(new Category("__cat3"));
  7.         categories3.add(new Category("__cat4"));
  8.        
  9.         ArrayList<Category> categories2 = new ArrayList<Category>();
  10.         categories2.add(new Category("_cat1"));
  11.         categories2.add(new Category("_cat2"));
  12.         categories2.add(new Category("_cat3", categories3));
  13.         categories2.add(new Category("_cat4"));
  14.        
  15.         ArrayList<Category> categories = new ArrayList<Category>();
  16.         categories.add(new Category("cat1"));
  17.         categories.add(new Category("cat2", categories2));
  18.         categories.add(new Category("cat3"));
  19.         categories.add(new Category("cat4"));
  20.  
  21.         CatAdapter adapter = new CatAdapter(this, categories);
  22.         elv.setAdapter(adapter);
RAW Paste Data
Top