I am doing Doing Dom Parsing from a news website for my android project. But i am finding a trouble.
I want to print the title element of the item tag (main tag).. in the list. And i did it. but i want when i click on the list item the corresponding data (example link, publishdate, title, description) will print in the next intent.For printing the titles in the list only titles of the items came in the array that i am pouring in the list.The remaining data is not coming in the array. So i am confusing in this problem. Can anybody suggest me appropriate suggestion.
Code for printing titles in the list is following :-
Here "messages" is a list. and "msg" is the object of Message class which has getter nd setter method.
loadFeed(){
try{
BaseFeedParser parser = new BaseFeedParser();
messages = parser.parse();
List<String> titles = new ArrayList<String>(messages.size());
for (Message msg : messages){
titles.add(msg.getTitle());
}
ArrayAdapter<String> adapter =
new ArrayAdapter<String>(this, R.layout.row,titles);
this.setListAdapter(adapter);
} catch (Throwable t){
Log.e("BBCNews",t.getMessage(),t);
}