• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Help How to populate activity from data array-list?

Hello I'm working on my Android project where I created Expandablelistview with men's and women's sports. Now I have to populate each sport with my text data which contains events. I'm stack at this point, already tried few thing but that did not work. Here is my data how it looks like:

this Main (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)
...
I have here my Main method where I have to pass data to each of my sports(activities). I tried to create a for loop and then pass result to my sport(activity) but I'm doing something wrong and can not get that work. Please if someone can help with this. Here is my code:

GroupedFeed findFeed(String locateSport){ //here I tried to create a loop which gonna search for certain sport in array list
//and then pass it to gfResult.
}
public boolean onChildClick(ExpandableListView parent,
android.view.View v, int groupPosition, int childPosition, long id) {
switch (groupPosition)
{
case 0: switch (childPosition) {
case 0:
gfResult = findFeed("Men's Baseball"); //once we find the sport we gonna pass it to correct place
Baseball(); // pass gfResult
break;
case 1:
MensBasketball();
break;
}
return false;
}

private void Baseball() {
Intent myIntent = new Intent(getBaseContext(), Baseball.class);
Intent.putExtra("Men's Baseball", [0] );
startActivity(myIntent);
}
...
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones