prchn4christ
Lurker
I'm trying to create a custom list view from an remote XML file.
Currently, I have the list view populated with a single data line, but I want to customize the layout of the list.
In my list_item.xml, I have created two TextViews, id/toptext and bottomtext.
However, I can't figure out how to change my java file to populate those text items.
Here is the relevant info from the java file. Right now, you can see I just have it populating my row, without specifying top and or bottom text. How do I make the 'headers' fill in the top text, and the 'dates' in the bottom text?
Thanks for your help!
Currently, I have the list view populated with a single data line, but I want to customize the layout of the list.
In my list_item.xml, I have created two TextViews, id/toptext and bottomtext.
However, I can't figure out how to change my java file to populate those text items.
Here is the relevant info from the java file. Right now, you can see I just have it populating my row, without specifying top and or bottom text. How do I make the 'headers' fill in the top text, and the 'dates' in the bottom text?
Code:
List<String> headers = new ArrayList<String>(messages.size());
for (Message msg : messages){
headers.add(msg.getHeader());
}
List<String> dates = new ArrayList<String>(messages.size());
for (Message msg : messages){
dates.add(msg.getDate());
}
ArrayAdapter<String> adapter =
new ArrayAdapter<String>(
this,
R.layout.list_item,
headers
);
this.setListAdapter(adapter);
} catch (Throwable t){
Log.e("Leading Ideas",t.getMessage(),t);
}
Thanks for your help!