How to programatically reboot a BLACKBERRY device?

2019-06-01 08:44发布

问题:

Is there an API that will allow you to reboot the blackberry device?

回答1:

Look at using the requestPowerOff() method in the Device class.

Edit: Ok, here's some sample code. To get the device to turn on again you have to schedule another application to run at some point in the future. You'll probably want to write an application that doesn't show anything to the user and schedule that. However, I happened to have the module name for the video recorder on me so I bring that back up.

    Device.requestPowerOff(true);
    int handle = CodeModuleManager.getModuleHandle("net_rim_bb_videorecorder");
    ApplicationDescriptor desc = 
        CodeModuleManager.getApplicationDescriptors(handle)[0];

    //Schedules the video recorder to come up two seconds after the current time.
    ApplicationManager.getApplicationManager().scheduleApplication(desc,   
          System.currentTimeMillis() + 2000, true);  


回答2:

Please try this code

http://aliirawan-wen.blogspot.com/2011/10/reset-programmatically-in-blackberry.html



回答3:

Device.requestStorageMode(). This will induce the device to reset (reboot)