i want to create a lwuit list screeen ,the list items are coming to my method from Rss Feed in a loop continuosly,but i am able to append 1 title from rss feed and able to display on device,after that 2,3,4,etcc...items are changing ,but finally,i am able to display 1 title and last title only,here is my code:
//method called by the parsing thread
public void addNews(News newsItem,Vector news) {
String newsArray[]={newsItem.getTitle()};
myNewsList = new List(newsArray);
System.out.println(newsItem.getTitle());//Here i am able to display,second title after that,it is not appending adding to myNewsList
//myNewsList.addItem(newsItem.getTitle());
form1.addComponent(myNewsList);
form1.show();
}
Can you help?
You need to read up about using Lists and the model in LWUIT. When using addItem you should invoke it from the EDT using LWUIT's callSerially method.
Regardless, calling addItem one by one is VERY slow. You should use a model to represent your data, see the makeover demo.