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: 44
Registered: ‎08-20-2008
My Device: Not Specified

Re: App won't exit

Aha! So that explains why the static data is sticking around.  Any idea why we get a SecurityException when calling System.exit(0)?

 

BlackBerry Development Advisor
Posts: 15,727
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: App won't exit

Are you calling System.exit from within a method fired by a listener?  If you want to stop listening for events you should unregister the listener instead.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: App won't exit

So presumably the OP has an app that contains a listener which registers to listen for events from another app.

When that app calls his method, he gets an exception because he is trying to kill the app related to the calling

thread, probably not the app which loaded the listener class?

 

Also, I would recommend the sun site for more general background on java questions that aren't

entirely RIM specific,  

 

http://www.google.com/search?hl=en&q=site%3Asun.com+securityexception&aq=f&oq=

 

 

New Developer
Posts: 44
Registered: ‎08-20-2008
My Device: Not Specified

Re: App won't exit

[ Edited ]

> Are you calling System.exit from within a method fired by a listener? 

 

No, from destroyApp in the class extending Midlet.

 

Would I expect to get a SecurityException if there are any listeners or threads still running?

 

 

Message Edited by nurikabe on 10-02-2008 09:59 AM
Highlighted
New Developer
Posts: 44
Registered: ‎08-20-2008
My Device: Not Specified

Re: App won't exit

Just coming back to this old issue.   The app is *defintiely* still running even though I've called a System.exit(0).  Trying to figure out why.

 

BlackBerry Development Advisor
Posts: 15,727
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: App won't exit

Are the static members shared by any other applications, libraries or listeners?  Note that static data does not equal a singleton.  I recommend having a look at this article.

 

How to - Create a singleton using the RuntimeStore
Article Number: DB-00686

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/832062/How_to_...

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 59
Registered: ‎07-01-2009
My Device: Android HTC One X
My Carrier: Cellcom

Re: App won't exit

I'm aware that this is an old thread, but I', facing the same problem. Is there there a known solution yet?