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
Regular Contributor
Posts: 59
Registered: ‎01-17-2011
My Device: 8520
My Carrier: Vodafone

Device reboot when pressing back button.

Hello Friends,

 

I design a Blackberry application with only one screen. and

I am using Socket connetion in my App, Which is run in background thread.

 

When i press back button on screen of my app, a Dialog has apear with Yes NO Button and message  "Do you want to Exit ?".

When user click on Yes button device reboot.

I write th code for Yes Button:

 

System.exit(0)

or

Runtime.getRuntime.exit(0);

 

Here my application doesn't close and reboot my device.

But As socket Downloading has been comepleted then i do this process. Then i successfully exit from app without reboot device..

 

What am i Doing wrong ..

Please help.

 

 

 

 

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

Re: Device reboot when pressing back button.

System,exit() (Runtime.getRuntime.exit(0)Smiley Winkwill stop any running Threads, so if you want your Thread to continue, just put your application in the Background

<application>.requestBackground();

 

I've no idea why this would reboot your phone.  Does it happen on the SImulator too?

 

Regular Contributor
Posts: 59
Registered: ‎01-17-2011
My Device: 8520
My Carrier: Vodafone

Re: Device reboot when pressing back button.

This is Not happen in Simulator But it happen in My Device 8520 5.0.0.63 OS. and i want to close my application not run in background.
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Device reboot when pressing back button.

"I want to close my application not run in background. "

 

I understand that, but closing the Application that starts a Thread will also stop the Thread.  Is that what you want?

 

Can I confirm that you are in fact using the JDE for 5.0 or earlier?  I have seen issues when a later level of JDE was used. 

Regular Contributor
Posts: 59
Registered: ‎01-17-2011
My Device: 8520
My Carrier: Vodafone

Re: Device reboot when pressing back button.

I am using JDE 5.0,
Actually i am using SQLlite, fileConnection, Network Connection, and Socket Connection all in my app.
Developer
Posts: 16,997
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Device reboot when pressing back button.

are you using a separate thread for blocking operations, like networking? if not, do so.

still, the device rebooting is a serious problem, but nothing one can do something about as a developer. you can check the device log (alt+lglg) for details.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter