开发者

Android Trun on backlight

I need to turn on screen back-light and keyboard backlight when my application receive notification. I have tried with PowerManager It it wasn开发者_JS百科't successful.

Is there any way to turn on screen and keyboard backlights?

Thank You.


I have solved this issue.

 private void backlightON(Context context){
          PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
          PowerManager.WakeLock wakeLock = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK |  PowerManager.ACQUIRE_CAUSES_WAKEUP, "MessageReader");
          wakeLock.acquire();
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜