以下のように11時にアラームが来るようにセットしていますが通知時間がずれてPUSHが来ます。
Calendarの設定に問題がありそうな気がするのですが、指定時間通りに通知が来ない原因を教えて下さい。
よろしくお願いします。
`
public void setAlarm(){
alarm = (AlarmManager)getSystemService(ALARM_SERVICE); intent = new Intent(this,ReceiveNotification.class); sender = PendingIntent.getBroadcast(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(System.currentTimeMillis()); cal.set(Calendar.HOUR_OF_DAY,11); cal.setTimeZone(TimeZone.getDefault()); alarm.setRepeating(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), AlarmManager.INTERVAL_DAY, sender); }
`

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。