BTW: This is for an Android app. Hey guys, I have made a ListView, and I have managed to add data to it. Here some example code of what I have done so far.
String[] gameListFin;
ArrayList<String> gameList = new ArrayList<String>();
gameList.add(someData);
gameListFin = gameList.toArray(new String[gameList.size()]);
listView = (ListView)findViewById(R.id.shortcutsList);
listView.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, gameListFin));
This works as it should, I have a list view with the items I want. But I need to add a bit of extra data as a subitem to the list view, and I don't know how to do so. So I was wondering if I did this:
String[] gameListFin;
String[] extraFin
ArrayList<String> gameList = new ArrayList<String>();
ArrayList<String> extra = new ArrayList<String>();
gameList.add("1");
gameList.add("2");
gameList.add("3");
gameList.add("4");
extra.add("1 extra");
extra.add("2 extra");
extra.add("3 extra");
extra.add("4 extra");
gameListFin = gameList.toArray(new String[gameList.size()]);
extraFin = extra.toArray(new String[extra.size()]);
How could I set it so that the String Array extraFin can be set to sub items of the list view, so it would say
1
1 extra
----------
2
2 extra
----------
3
3 extra
----------
4
4 extra
Thanks for your time and help, help will be greatly apriciated. zeokila