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
02cp682
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
Please use plain text.
Developer
02cp682
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
Please use plain text.
Developer
mreed
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
Please use plain text.
Developer
02cp682
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
Please use plain text.
Developer
peter_strange
Posts: 19,595
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.
Please use plain text.
Developer
02cp682
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
Please use plain text.
Developer
peter_strange
Posts: 19,595
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.

Please use plain text.