backlight一直存在
程序员文章站
2022-06-30 14:20:01
...
1.
getWindow().setFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON, WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
2.PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK , "My Tag");
wl.acquire();
// ..screen will stay on during this section..
wl.release();
两种方法