I’m new to Java and Android development and i’m stucked while trying to populate an ArrayAdapter to creating a ListView. The code below works perfectly:
String name[] = {"a","b","c",
"d","e"};
this.setListAdapter(new ArrayAdapter<String>(this,
R.layout.row, R.id.label,
name));
But I simply can’t figure out how I should populate name with a for loop. All suggestions are welcome.
ArrayAdapteralso has a constructor that takes aList<String>, so you can just doOtherwise it just boils down to populating an array with data.