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: 455
Registered: ‎01-14-2009
My Device: Apple iPhone 3GS 16GB

Show Busy while device is Busy

Hello friends.

 

I am creating an app which uses files for various purposes. While the files are read,written or merged the app displays the Busy icon (Somehthing like a clock). Unlike others who want to display the hour glass while the app is busy ,what i want to do is to display a message ("Busy") while the device is actually busy reading or writing. Sometimes it takes upto 4 seconds..i cant predict how long it takes. so how can show a busy message whilst the device is actually busy ? is there any api to know when the device is actually busy? (when it is showing the clock icon?)

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Show Busy while device is Busy

After start up, if you see the clock icon, it typically means that the device is doing a garbage collection.  And no you don't want to initiate a garbage collection just to get the clock up for your app.

 

There is, as far as I know, no APi to display something similar from your application. 

 

Remember that though you application is busy, other applications can still be running, so you don't actually want to lock the device. 

 

The easiest thing to do is to push a PopupScreen, then pop it when you are finished.  The popup screen will just say something like "Busy - Please wait" and will swallow all input, meaning that your application is locked, however the user will will able to ALT-ESC to task switch to another application if they want, and you should probably allow 'ESC' to put your application into the background too. 

 

There is also an argument that says you should try to keep you application running, and only disable the parts of it that are waiting for the processing to finish, but for 3 or 4 seconds, that is probably not worth the extra coding. 

Developer
Posts: 455
Registered: ‎01-14-2009
My Device: Apple iPhone 3GS 16GB

Re: Show Busy while device is Busy

Hello,

 

I did something to my code without the hope of getting it right but now it s working voila.

 

I  just inserted this code. And now what happens is as the app is busy by itself, this message is displayed as long as the app is busy,.lol

Status.show("Please Wait",Bitmap.getPredefinedBitmap(Bitmap.HOURGLASS),100);

 

 

 

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Show Busy while device is Busy

I use that in places too, however be aware that this can be dismissed by the user using ESC.  However if you are already processing on the Event Thread (which you shouldn't really be for that length of time), then this will work fine.