开发者

Android Trun on backlight

开发者 https://www.devze.com 2023-01-31 04:49 出处:网络
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.

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

精彩评论

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