So, I'm still a bit new to Android and tried to find some help online but I can't seem to find a clear solution. I'm creating an app that consists of only a ListView. I created an xml file that consists of 2 textviews (it's basically the same as the built-in android.R.layout.simple_list_item_2 layout but I'm guessing I may need to change this). It looks like this:
TextView1
TextView2
Nothing fancy. The problem I'm coming across is working with arrays. For my app, TextView1 will simply be a set String. Textview2, though, will technically not just be a single TextView. I'd like to take an array, create the necessary number of TextViews, and place them in each row of the ListView under TextView1.
For example, if I have these 3 arrays:
String[] array1 = {TextView1A, TextView1B, TextView1C, TextView1D};
String[] array2 = {TextView2A, TextView2B};
String[] array3 = {TextView3A, TextView3B, TextView3C};
I'd like the output to look something like this:
TextView1
TextView1A
TextView1B
TextView1C
TextView1D
TextView2
TextView2A
TextView2B
TextView3
TextView3A
TextView3B
TextView3C
Like I said, I'm still a bit new to teaching myself android. I've done simple ListViews through ArrayAdapters but I'm not sure if that would work here. I'd like to create this with more arrays that can each have a different number of elements so I really don't think simply creating a ton of custom ListView rows would be an option. I really have no idea how to even begin implementing this so any push in the right direction would be appreciated. Any other suggestions on how to do this are also welcome. Thank you.