09-25-2008 12:16 PM
Does anyone know how I can go about stopping the system "busy" icon appearing in the middle of the screen every few seconds?
My app is connecting to the net and doing a whole load of stuff, but the net-transaction icon is in the top-right and quite out of the way of any of my app's hud/screen items...
...but having this icon in the middle of the screen every few seconds is really annoying - help!
Solved! Go to Solution.
09-25-2008 12:39 PM
Don't tie up the UI thread ? I've found calling System.gc() seems to do it too.
Seriously, AFAIK, it seems to notice a backlog of stuff in the UI message queue ( I'm assuming something like that exists).
Perhaps a fews yields/sleeps would help assuming you aren't overtly blocking/using the UI thread for real work.
09-25-2008 06:10 PM
I agree with marchywka - this is likely to be related to garbage collection, though I remember on the old forum, there was one user who had this because some combination of calls that he was doing got a bit cyclic.
I would recommend that you attach the device to the debugger and watch the output - if you see messages like
when the hourglass appears, then I think this will confirm that it is the OS doing a full garbage collection that is displaying it.
So the question then is why? What is happening on your device at the time?
If you suspect your code, I would encourage you to use the profiler in the JDE. It tells you an overwhelming amount of stuff, from the 'ticks' in various lines in your code to the amount of storage occupied by objects. Have a play with this. From memory I picked up how to use it from the help, though I think there is a Lab that does it as well.
09-26-2008 05:46 AM
Ah. At the moment I'm not even using the JDE - I'm using Jedit and a custom-written ANT build system
The System.gc() calls could be the puppy - whoever originally wrote the code I'm porting had a _lot_ of gc calls. Cutting those right back cured by problem - thanks!
09-26-2008 07:15 AM
I put a call in after getting to a dead spot where nothing works - it didn't seem to help anything
but it did put up the hour glass. Hard to say if it avoids problems later but maybe you can profile your
app with and without and see if there is any net benefit.
09-26-2008 08:23 AM