如何以编程方式重新启动BlackBerry设备? [英] How to programatically reboot a BLACKBERRY device?

查看:189
本文介绍了如何以编程方式重新启动BlackBerry设备?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一个API,让你重新启动BlackBerry设备?

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

推荐答案

看看使用 requestPowerOff()在设备类中的方法。

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

编辑:好吧,这里是一些示例code。要获得设备再次打开,你必须安排另一个应用程序在未来的某一时刻运行。你可能会想编写不显示任何内容给用户,并安排一个应用程序。但是,我碰巧有对我的录像机模块的名字,所以我提起这回来了。

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);  

这篇关于如何以编程方式重新启动BlackBerry设备?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆