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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 80
Registered: ‎08-26-2008
My Device: 8800, 8100

Help !! PhoneListener lost if i do System.exit(0)

hi all, 

in my application, there r two entry points

1st registers phoneListner at phone startup( autostartup )

2nd lounches  application manually..

 

now when i use system.exit(0) to exit from my app, i also lost my registered phoneListener....a big prob !!!

 

any solution???? 

Jeet Bhatt, India
Developer
Posts: 80
Registered: ‎08-26-2008
My Device: 8800, 8100

Re: Help !! PhoneListener lost if i do System.exit(0)

no one???
Jeet Bhatt, India
Developer
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: Help !! PhoneListener lost if i do System.exit(0)

[ Edited ]
That should be expected when using System.exit().

Try Application.requestBackground() to hide the app.
Message Edited by mreed on 09-16-2008 10:20 AM
Developer
Posts: 80
Registered: ‎08-26-2008
My Device: 8800, 8100

Re: Help !! PhoneListener lost if i do System.exit(0)

i think u'hv pointed the right direction..ok let me try..
Jeet Bhatt, India
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Help !! PhoneListener lost if i do System.exit(0)

In my experience, the PhoneListener is not removed when your application issues a System.exit(0).  Other things like ApplicationMenuItems are also not removed.  In your situation I would carefully debug your Phone Listener to ensure that there is not some other problem, for example, where the Listener requires something supplied by your Application.
Developer
Posts: 80
Registered: ‎08-26-2008
My Device: 8800, 8100

Re: Help !! PhoneListener lost if i do System.exit(0)

Hi peter,

 

yes i also believe the same thing as u said..but my code just behaving unexpectedly, so i m confuse..

when my app fires system.exit(0), immediately i cant catch phone events for which i had registered phoneListener 

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

Re: Help !! PhoneListener lost if I do System.exit(0)

Given that it works for me, and doesn't work for you, then this suggests there is a issue with your setup.  So you are going to have to give us more if you expect us to help.  We will need to know how you are testing including things like Level, OS Level, what messages you see or don't see, what debugging you have done, and so on.

 

However in your case, I would create a very simple Phone Listener, that just does something like System.out.println(...) in the interface methods, add that rather than your real one, and use it to prove that you are really NOT going through the Phone Listener.  Creating this also means that if you see a problem, you can give easily give us the code to try.