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
New Developer
Posts: 9
Registered: ‎04-09-2009
My Device: Not Specified

Any way to change the error msg when application is killed?

I wrote a Jdava Application - when launch it but no any futher user interaction, just leave it there over the night, I would get exception: "Uncaught exception: Application xxxx(xxx) is not responding; process terminating." I know when I got this error, means my application has been killed by OS, but wonder if there is anyway I can customize the string (like, settings, etc) or make it not showing?
Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Any way to change the error msg when application is killed?

This message means that your application is doing something in the event thread that it should not be doing. This is not a cosmetic issue - you need to fix the code.

 

Some common causes:

 

* performing blocking IO, like HTTP or sockets

* getting a GPS fix

* performing time-consuming operations like lengthy calculations in a loop

 

 

 

New Developer
Posts: 9
Registered: ‎04-09-2009
My Device: Not Specified

Re: Any way to change the error msg when application is killed?

[ Edited ]

Hello RexDoug,

 

In most case it works fine unless leave it there for long without user interaction, like over the night. So wonder if there any way to chagne the error message from device settings?

 

Cecelia

Message Edited by Cecelia on 09-13-2009 11:47 PM
Developer
Posts: 84
Registered: ‎09-21-2008
My Device: Not Specified

Re: Any way to change the error msg when application is killed?

If you are getting that error message, then you really need to track down what is causing your application to not respond.. The fact that it doesn't happen to you very frequently is irrelevant, because if you deploy the code to many people it will happen more and more frequently and annoy the people who are using your application, you really are serving yourself by tracking down the root cause instead of trying to hide the problem.

 

Irrespective of the fact that your code has a pretty serious flaw that should be addressed, there is no way to change that particular error message or catch the exception and handle it because that message is by definition only displayed when your application is NOT responding to system and hence would not respond to any notification that the message is about to be displayed. 

 

RegDoug has provided some pretty good common causes of the issue, the solution is to use a thread to do anything that MIGHT take some time.. Any expensive computations should not be executed on the event thread. 

Highlighted
Developer
Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: Any way to change the error msg when application is killed?

You should find out what's causing the issue and fix it. Run the application in a simulator overnight and see whether you can reproduce the issue -- the debugger will show which thread were blocked. If not, obtain the event log using JavaLoader from an actual BlackBerry on which the issue occurred and then analyze the stack traces.