Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
peter_strange
Posts: 19,610
Registered: ‎07-14-2008
My Device: Not Specified

Re: IllegalStateException in ListField

I may have said the wrong thing earlier.  The code that should all be in the invokeLater is this code:

 

Status.show("Hey there is no network connection!!!");
app.popScreen(waitScreen);
vector= dataUtils.getRegionItems();
if(vector==null)
{
Status.show("Something is not right here.\nPlease try again later.");
return;
}
ListCallBack callback = new ListCallBack();
lf.setCallback(callback);
lf.setRowHeight(100);
lf.setSize(vector.size());
vfm.add(lf);
return;
}

 

Developer
JoVinz
Posts: 255
Registered: ‎05-03-2012
My Device: 9930

Re: IllegalStateException in ListField

[ Edited ]

Thanx for the help. It works. There is one more problem. Alongwith the posted code there is one more thread from which i am drawing bitmaps on each row of listfield asychronously. In this case,when screen is displaed, its gets hang until images are fetched from web,if i use this thread with the thread you have suggested. how to overcome this problem?

Developer
peter_strange
Posts: 19,610
Registered: ‎07-14-2008
My Device: Not Specified

Re: IllegalStateException in ListField

"its gets hang until images are fetched!"

 

This suggests that there is processing running on the Event Thread, blocking the screen.  So that is the first thing to look for

 

If the Thread is running on a separate Background Thread, then look at the coding you do while updating the UI from that Thread.  You should minimize this.  For example, if you need to convert the bytes received to images, that processing does not need to be done on the Event Thread and can be done as part of the Background Tread processing.