I have an application that does some calculations based on input to a form, which takes up about 1/2 a screen. I want to populate a ListView or some sort of table in the bottom half of the screen depending on the choices in the top half.
At the moment I'm getting static data output when I hit submit using the following:
Using java Syntax Highlighting
- public void setSplits() {
- lv = (ListView) findViewById(R.id.ListView01);
- ListAdapter birds = (ListAdapter) ArrayAdapter.createFromResource(this,
- R.array.species, android.R.layout.simple_list_item_1);
- lv.setAdapter(birds);
- lv.setTextFilterEnabled(true);/**/
- }
Parsed in 0.011 seconds, using GeSHi 1.0.8.4
Using xml Syntax Highlighting
- <ListView android:id="@+id/ListView01"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@+id/EditText03a" />
Parsed in 0.000 seconds, using GeSHi 1.0.8.4
This creates a nice, scrollable ListView in the bottom half of the screen which wasn't there when app loaded, but it's from a resource (xml array). I need it to take values I feed the ListView from an ArrayList after calculations from the form, or some other similar Java container which is empty to begin with.
1. Any sample code of populating a ListView NOT from "createFromResource"
2. Anyone recommend a better View for this rather than a ListView? I want it to be two equal columns, each column left justified with text only, and scrollable.
Thanks in advance
Iain