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: 8
Registered: ‎10-25-2012
My Device: Blackberry 9790

How can I programmatically reboot a Blackberry System?

[ Edited ]

hi all

 

this my first topic, sorry if u find some grammer mistake because it is not my native language.

 

let's go to the point.

 

I went make my program reboot the system when the button pressed.

 

I do the code of the button and everything but I can't find in BlackBerry API the mothed do reboot.

 

I try put in button listener this mothed

 

Device.requestPowerOff( true )

 

but it just do device sleep.

 

anyone know how to do this ?

Developer
Posts: 16,584
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: How can I programmatically reboot a Blackberry System?

there is no API for that.

you can use a workaround, but it is a bit complicated:
use CodeModuleManager to install an autostart module and delete it with force set to true
http://www.blackberry.com/developers/docs/7.1.0api/net/rim/device/api/system/CodeModuleManager.html#...
----------------------------------------------------------
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
New Developer
Posts: 8
Registered: ‎10-25-2012
My Device: Blackberry 9790

Re: How can I programmatically reboot a Blackberry System?

Thanks for ur reply

 

I will try it .

New Developer
Posts: 8
Registered: ‎10-25-2012
My Device: Blackberry 9790

Re: How can I programmatically reboot a Blackberry System?

it is work thanks but I have problem

 

when I run the program in the simulator works.

 

but when I load it to my device and press the button nothing happen?

 

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

Re: How can I programmatically reboot a Blackberry System?

And when you debug on device, how far through your code do you get and how does it fail?