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
Posts: 61
Registered: ‎04-02-2008
My Device: Not Specified

Update Status line

 

   I'm using a Mainscreen in an application for the primary screen, and have a communication thread for interaction with various servers.  The problem I'm having is when the users selects an option from the menu that requires the app to communicate, I want the mainscreen to display something in the Status line at the bottom of the mainscreen.  Then when the communication is complete, I want the Status line to be cleared.

 

   My current approach has been to override paint(graphics) on one of the field managers I've added to the mainscreen so that it queries a status variable shared with the communication thread, which for the most part works except some times the paint code doesn't always seem to be called once the user has selected the menu item from the mainscreen that requires communication (or there is several seconds of lag before paint is called to realize there is a change needed).

 

   At one point I tried having the menu item selected pop/push the mainscreen to force it to redisplay, but there is still a lag before the mainscreen displays.

 

   Are there any suggestions how to make the Status line changes more real time?  Is there a better way of doing this?

 

fbwing

Developer
Posts: 16,992
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Update Status line

you can use MainScreen.setStatus to display something in the status bar.

to directly update your GUI you can use something similar to this article in the knowledge base:
http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800451/800783/How_To_-_Allow_a_background_listener_to_detect_and_update_a_GUI_application.html?nodeid=827026&vernum=0

it is a bit complicated but works for many different occasions.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Highlighted
Developer
Posts: 61
Registered: ‎04-02-2008
My Device: Not Specified

Re: Update Status line

Hi Simon,

 

   Thanks for the quick reply.

 

   I'm using the RuntimeStore to store an instance of my communication thread so my mainscreen and interact with it, so I should do the same with my mainscreen so the communication thread can communicate with it?  For some reason I thought you only wanted to do this in one direction not both, but I'll give it a try.

 

fbwing