01-13-2011 12:44 PM
I'm having a problem debugging my program on a device through the "debug on a device" option in eclipse (curve 8520). Sometimes when I run the program and then exit it and try to reload a new build, the device reboots. This is very annoying as it takes a while to boot up. Before this only happened when the program thread was still running, but now it seems to be all the time.
I have been using MIDP RecordStores but deleted them all in the program and then removed all references to that code or any other code that I added when the reboots started to happen. Yet the reboots still happen (on rare occasions they don't but I havent been able to reproduce when that exactly is the case).
which gives some ideas on what could cause it, but none of them seem to be relevant to my program.
Can someone give me any idea what could be causing this?
01-13-2011 10:37 PM
It's exactly what you found. You install a new version of your app on the device and it requires a reboot. The debugger forces the device to reboot.
01-14-2011 04:23 AM
Thank you for your reply.
The problem is, this doesn't happen all the time. Sometimes I can replace the app without rebooting while it's still there.
I think the problem is with something that keeps running or keeps the app locked. When I try to remove it, my bb will say "the app is in use, do you want to reboot to remove it?".
I don't see any threads in the debugger though, and the debug output says the app has exited, so I can't figure out what the problem is exactly.
I don't want my app to keep running something while it's supposed to shut down.
01-14-2011 07:01 AM
Ok, I seem to have traced it to the difference between using the escape key to exit the app and using Menu -> close.
I intercept the escape key and do a System.exit(0); but somehow this doesn't close it completely. The menu -> close works fine.
Does someone have an idea what could be wrong?
01-14-2011 10:12 AM
Don't take my word for it but I think that System.exit closes only the main thread, any other threads will still be running. If you use Menu->close then it closes the other threads and then the main thread.
01-14-2011 11:23 AM
This is the second thing today that's stumped me.
What changes do you make? Simply adding more code? Do you have a record/persistent/runtime store? System listeners?
01-14-2011 12:02 PM
Can't figure it out, sometimes it happens, sometimes it doesn't.
I disabled pretty much everything, it's just a Screen push now.
I think i'll just disable the escape button for now and force myself to close it with the menu. Thanks for your help so far.
01-14-2011 12:23 PM
No problem, maybe someone else here will be able to help you.