Andreapirlo
Lurker
Hello everyone I'm working on my Android project where I created expandable list view with Men's and Women's sports. Under each of them I have a list of sports. Each sport after you click on it open new activity. Example: If you click on Men's sports then Baseball you will open new activity where you get listed all Baseball events from database. I'm on that point where I created my expandable list view and my activities for each sport, now I have to populate each sport from data base. My data base is sorted in array-list from 0 to 11. Here is how it looks my database sorted in array-list:
thisMain(id=831962574768)
groupedFeeds ArrayList(id=831963150464)
array Object[12](id=831963153088)[0]GroupedFeed(id=831963152968)
category "Women's Golf"(id=831962986192)
feeds ArrayList(id=831963152992)[1]GroupedFeed(id=831963153592)
category "Volleyball"(id=831962991720)
feeds ArrayList(id=831963153616)[2]GroupedFeed(id=831963153744)
category "Men's Soccer"(id=831962996544)
feeds ArrayList(id=831963153768)[3]GroupedFeed(id=831963153896)
category "Women's Soccer"(id=831963006320)
feeds ArrayList(id=831963153920)[4]GroupedFeed(id=831963154864)
category "Men's Golf"(id=831963016488)
feeds ArrayList(id=831963154888)[5]GroupedFeed(id=831963155072)
category "Men's Cross Country"(id=831963036816)
feeds ArrayList(id=831963155096)[6]GroupedFeed(id=831963155224)
category "Women's Cross Country"(id=831963041984)
feeds ArrayList(id=831963155248)[7]GroupedFeed(id=831963155472)
category "Men's Bowling"(id=831963093056)
feeds ArrayList(id=831963155496)[8]GroupedFeed(id=831963155712)
category "Women's Bowling"(id=831963098224)
feeds ArrayList(id=831963155736)[9]GroupedFeed(id=831963155864)
category "Women's Basketball"(id=831963170720)
feeds ArrayList(id=831963155888)
Now I have to populate my Expandable List View for each Sport(Activity). Here is my Main method where I have to create function to populate my sports. I put the comments where that function suppose to be and how I think that should populate inside of the ecah sport. Please if someone can help I'm stuck and can not figure it out.
publicclassMainActivity<View>extendsActionBarActivity{
ExpandableListView exv;List<GroupedFeed> gfList;GroupedFeed gfResult;
@Overrideprotectedvoid onCreate(Bundle savedInstanceState){super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
exv=(ExpandableListView)findViewById(R.id.expandableListView1);
exv.setAdapter(newMyAdapter(this));
exv.setOnChildClickListener(newOnChildClickListener(){
**// Create GroupedFeed findFeed(String locateSport);
publicboolean onChildClick(ExpandableListView parent,
android.view.View v,int groupPosition,int childPosition,long id){switch(groupPosition){case0:switch(childPosition){case0:
**// Call gfResult = findFeed("Men's Baseball");Baseball();**// pass gfResultbreak;case1:MensBasketball();break;
thisMain(id=831962574768)
groupedFeeds ArrayList(id=831963150464)
array Object[12](id=831963153088)[0]GroupedFeed(id=831963152968)
category "Women's Golf"(id=831962986192)
feeds ArrayList(id=831963152992)[1]GroupedFeed(id=831963153592)
category "Volleyball"(id=831962991720)
feeds ArrayList(id=831963153616)[2]GroupedFeed(id=831963153744)
category "Men's Soccer"(id=831962996544)
feeds ArrayList(id=831963153768)[3]GroupedFeed(id=831963153896)
category "Women's Soccer"(id=831963006320)
feeds ArrayList(id=831963153920)[4]GroupedFeed(id=831963154864)
category "Men's Golf"(id=831963016488)
feeds ArrayList(id=831963154888)[5]GroupedFeed(id=831963155072)
category "Men's Cross Country"(id=831963036816)
feeds ArrayList(id=831963155096)[6]GroupedFeed(id=831963155224)
category "Women's Cross Country"(id=831963041984)
feeds ArrayList(id=831963155248)[7]GroupedFeed(id=831963155472)
category "Men's Bowling"(id=831963093056)
feeds ArrayList(id=831963155496)[8]GroupedFeed(id=831963155712)
category "Women's Bowling"(id=831963098224)
feeds ArrayList(id=831963155736)[9]GroupedFeed(id=831963155864)
category "Women's Basketball"(id=831963170720)
feeds ArrayList(id=831963155888)
Now I have to populate my Expandable List View for each Sport(Activity). Here is my Main method where I have to create function to populate my sports. I put the comments where that function suppose to be and how I think that should populate inside of the ecah sport. Please if someone can help I'm stuck and can not figure it out.
publicclassMainActivity<View>extendsActionBarActivity{
ExpandableListView exv;List<GroupedFeed> gfList;GroupedFeed gfResult;
@Overrideprotectedvoid onCreate(Bundle savedInstanceState){super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
exv=(ExpandableListView)findViewById(R.id.expandableListView1);
exv.setAdapter(newMyAdapter(this));
exv.setOnChildClickListener(newOnChildClickListener(){
**// Create GroupedFeed findFeed(String locateSport);
publicboolean onChildClick(ExpandableListView parent,
android.view.View v,int groupPosition,int childPosition,long id){switch(groupPosition){case0:switch(childPosition){case0:
**// Call gfResult = findFeed("Men's Baseball");Baseball();**// pass gfResultbreak;case1:MensBasketball();break;