2012-02-01 86 views

回答

1

關於禁用睡眠模式,您可以閱讀this文章。

爲了解決黑莓這個問題,我使用以下代碼:

import net.rim.device.api.system.Backlight; 
import net.rim.device.api.util.DateTimeUtilities; 

int MAX_BACKLIGHT_TIMEOUT_SECS = 255; 

.... 

Backlight.setTimeout(MAX_BACKLIGHT_TIMEOUT_SECS); 
Timer timer_ = new Timer(); 

timer_.scheduleAtFixedRate(new TimerTask() 
{ 
    public void run() 
    { 
     Backlight.enable(true); 
    } 
}, 
(MAX_BACKLIGHT_TIMEOUT_SECS - 1) * DateTimeUtilities.ONESECOND, 
(MAX_BACKLIGHT_TIMEOUT_SECS - 1) * DateTimeUtilities.ONESECOND);