를 사용하여 웨이크 업 장치 알람이 울리면 안드로이드 : 내가 설정 알람에 대한 follwing을 코드를 사용하고 알람
Intent intent = new Intent(context, Receiver.class);
PendingIntent pendingIntent = PendingIntent.getBroadcast(reminderContext, 0, intent,
PendingIntent.FLAG_CANCEL_CURRENT);
alarmManager.set(AlarmManager.RTC_WAKEUP,
System.currentTimeMillis()+delay,pendingIntent);
, 나는 새로운 활동을 보여주고 소리가 재생되는 동일한 코드를 실행. 이것은 좋지만 장치가 절전 모드에있는 경우 알람이 울리면 소리 만들을 수 있습니다. 활동이 표시되지 않고 장치가 수면 모드로 유지됩니다.
알람이 울릴 때 내 장치가 자동으로 켜지도록하려면 어떻게해야합니까?
는 편집 : 또한
04-10 13:49:59.260: A/PowerManager(4292): WakeLock finalized while still held: TAG
, 나는 취득 방법에이 경고를 가지고 :
을 보였다PowerManager pm = (PowerManager) getApplicationContext().getSystemService(Context.POWER_SERVICE);
WakeLock wakeLock = pm.newWakeLock((PowerManager.SCREEN_BRIGHT_WAKE_LOCK | PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP), "TAG");
wakeLock.acquire();
KeyguardManager keyguardManager = (KeyguardManager) getApplicationContext().getSystemService(Context.KEYGUARD_SERVICE);
KeyguardLock keyguardLock = keyguardManager.newKeyguardLock("TAG");
keyguardLock.disableKeyguard();
이 제외 일 :
나는 다음과 같은 시도발견 된 wakelock acquire() 하지만 릴리스() 어디
가능한 중복 https://stackoverflow.com/questions/ :
알람 설정이 업데이트 블로그를 통해 이동하십시오 5262641/can-i-wake-up-my-android-when-it-not-plug-in-and-sleeping) –