Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jul 21st, 2013  |  syntax: Java  |  size: 1.02 KB  |  views: 391  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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);
clone this paste RAW Paste Data