I am parsing an RSS feed using SAX
messages = parser.parse();
List<String> titles = new ArrayList<String>(messages.size());
for (Message msg : messages){
titles.add(msg.getTitle() + "\n" +msg.getDate() + "\n\n" + msg.getDescription());
}
ArrayAdapter<String> adapter =
new ArrayAdapter<String>(this, R.layout.row,titles);
this.setListAdapter(adapter);
This creates a good list with the whole message included, but I would just like to show the name and date in the list.
Here is my onListItemClick right now
protected void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id);
String selection = l.getItemAtPosition(position).toString();
Dialog dialog = new Dialog(this);
dialog.setContentView(R.layout.single);
dialog.setTitle("Blog");
dialog.setCancelable(true);
TextView text = (TextView) dialog.findViewById(R.id.SinglePost);
text.setText(selection);
dialog.show();
}
but it just pops up what is on the list.
Is there a way to pass a description to a list without showing it, so when they click on a list item, is there only a description in the dialog box? Thank!
source
share