04-15-2010 02:08 AM
Hi all,
I got this issue when i restart the phone and start a thread.below is my code.
//in main
iMainAppClass = new MainAppClass();
iMainAppClass.enterEventDispatcher();
.............................................
MainAppClass()
{
iAppThread =new AppThread ();
iAppThread .startthread();
iAppThread .start();
}
........................................................
private class AppThread extends Thread { public void run() { for(;;) { if(condition) return; try { Thread.sleep(600); Thread.yield(); } catch (InterruptedException e) { // TODO Auto-generated catch e.printStackTrace(); } } } }
04-15-2010 06:12 AM
Hi, Please anybody reply on above issue .i need to know what is wrong in above code.
Thanks,
sunil
04-15-2010 06:13 AM
And exactly what issue do you get? Have you run this in the simulator so you know what line is causing the problem?
And what does this line do?
iAppThread .startthread();
04-15-2010 06:47 AM - edited 04-15-2010 06:52 AM
Hi peter,
Thanks for reply. i got app 169 process terminated. app is not responding.actaully startthread just set the condition flag false nothing else in that funtion.this thread continuesly run at background after reboot the real device 8900 curve.
is that becouse i sleep the thread, does it create the problem?
Thanks,
sunil
04-15-2010 08:13 AM
There doesn't appear to be anything wrong with your Thread. I would try the application with everything remaining the same, except that I would not start the Thread (i.e. comment out .start()). That will see if the problem is in your Thread or elsewhere.