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
Regular Contributor
Posts: 52
Registered: ‎02-26-2013
My Device: Curve 9650,Bold 9900
My Carrier: Airtel

ui hangs when thread running in background


I have develope an app in which i used both ui and backgroung thread.Therad works fine, but after some time ui hangs(i mean ui works very slowly ). Thread running after every 1 minute and check the database records, and ui also fetch the records from the same database and display on screen.
I have called ui screen in main class ( UiApplication )constructor through pushScreen methos and therad is calling in main method of this class
Class A extends UiApplication
{ A()
   {
         pushScreen(new ABC());

   }
  public static void main(String args[])
   {
     //       Thread calling.
   }
 }

I wants my ui works smoothly..
What should i need to do for this problem...?

Thanks in advance.

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

Re: ui hangs when thread running in background

please show the code where you launch the thread.
are you using a second thread for the db access in the UI? If not, do so, all blocking processing, like database i/o, should not be done on the UI thread.
----------------------------------------------------------
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