0

I have a ListViewItem in which i want to display an array of strings. problem is the array is of variable size. so setting up an xml with a TextView for every item in the array wont work.

Is there any other way to accomplish this? For example by defining the layout in code or setting up one TextView and setting up a single string with line breaks?

Any suggestions?

GuyFawkes
  • 1,686
  • 3
  • 17
  • 30

1 Answers1

0

You should use a listadapter and create a class that extends ArrayAdapter and then in your getView function you should implement each row from an arraylist or array. It is not so much easy, you can see a working example here

http://www.softwarepassion.com/android-series-custom-listview-items-and-adapters/

Yekmer Simsek
  • 4,102
  • 3
  • 21
  • 19