How to programatically reboot a BLACKBERRY device?

2019-06-01 09:00发布

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

3条回答
祖国的老花朵
2楼-- · 2019-06-01 09:27

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

查看更多
劳资没心,怎么记你
4楼-- · 2019-06-01 09:32

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);  
查看更多
登录 后发表回答