当前位置:编程学习 > wap >>

黑莓如何保持背景灯常亮,不希望自动锁屏

黑莓如何保持背景灯常亮,不希望自动锁屏,看到了一个获取锁屏时间的函数DeviceInfo.getLockTime(),但是没有找到设置的函数。android可以使用getWindow().addFlags(WindowManger.LayoutParams.FLAG_KEEY_SCREEN_ON) --------------------编程问答-------------------- net.rim.device.api.system.Backlight
这个类也许能帮助你,不过我看了下背光的超时时间在1-255秒之间。
我的想法是用定时器,获取系统的超时时间int timeout = getTimeoutDefault(),定时器每隔timeout调用Backlight.enable(true)。不知道你有没有更好的办法。
代码:

int timeout = Backlight.getTimeoutDefault();
Timer timer = new Timer();
timer.schedule(new TimerTask() {
public void run() {
Backlight.enable(true);
}
}, timeout * 1000);
--------------------编程问答-------------------- 上面代码有问题,应该是这样:
int timeout = Backlight.getTimeoutDefault();
Timer timer = new Timer();
timer.schedule(new TimerTask() {
    public void run() {
        Backlight.enable(true);
    }
}, 0, timeout * 1000);
--------------------编程问答-------------------- 貌似只能设置Backlight --------------------编程问答-------------------- --------------------编程问答-------------------- --------------------编程问答-------------------- --------------------编程问答-------------------- 试试吧 --------------------编程问答-------------------- ding  le
--------------------编程问答-------------------- --------------------编程问答-------------------- 这个我也感兴趣
补充:移动开发 ,  BlackBerry
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,