Get ListView From Activity and Programmaticly Populate With XML String Array

openforme

New Member
I'm having some trouble figuring something out that should be quite easy and straight forward. I have an activity that has a few Views in it including a ListView that currently is not populated.How do you programmaticly get a reference to that ListView and then set the items, each item being a TextView with the content then being XML String-Array items?Getting reference I suppose is like this:\[code\]ListView incomeList = (ListView) findViewById(R.id.incomeList);\[/code\]Also I have a this code in my strings.xml(Want to populate list with this array):\[code\]<string-array name="testArray"> <item>Item1</item> <item>Item2</item> <item>Item3</item> <item>Item4</item> <item>Item5</item></string-array>\[/code\]And then lastly I have this other layout xml file that I should have according to all the tuts out there. list_item.xml\[code\]<?xml version="1.0" ebcoding="utf-8"><TextView xmlns:android="blablabla..." android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="10dp" android:textSize="16sp"</TextView>\[/code\]All of the tutorials I followed on the web though is helpfull if a ListView is the only View in your activity. Whereas in my case I have quite a few Views including buttons, textviews etc etc.(If this might be helpfull to know). Also do I extend my class with ListActivity or since I have other views in there, just extend normally with Activity??Thanks!
 
Back
Top