<uses-permission android:name="android.permission.WAKE_LOCK" />
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
| WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD
| WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
| WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
-----------------------------------------------------------------------------------
꺼져있는 화면을 켜기 위한 코드이다.
final Window win = getWindow();
win.addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
| WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
if (!getIntent().getBooleanExtra("screen_off", false)) {
win.addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
}