Instead of reading files, I displayed the entries from two RSS feeds to the left and right text areas respectively, using the following doInBackground() method:
Code:
@Override public String doInBackground(){
StringBuilder result = new StringBuilder();
SyndFeedInput feedInput;
feedInput = new SyndFeedInput();
SyndFeed feed = null;
try {
feed = feedInput.build(new InputSource(feedURL));
}
catch (Exception e) {
e.printStackTrace();
}
List<SyndEntry> entryList = feed.getEntries();
for (int i = 0; i < entryList.size(); i++) {
result.append("Title: " +
(entryList.get(i)).getTitle() +
"\n" +
"Link: " +
(entryList.get(i)).getLink() +
"\n" +
"\n");
}
return result.toString();
}
I'm wondering how to do to have the application look for updates and display the new items in the text areas as soon as they are distributed.