6

こんにちは、アプリケーションを毎日特定の時間に実行したいと考えています。このために、以下のコードを使用しています。しかし、それは一度だけ実行されます。ここでの間違いは何ですか。どうすればこのタスクを達成できますか。

AlarmManager alarmMgr0 = (AlarmManager)getSystemService(Context.ALARM_SERVICE);
Intent intent0 = new Intent(this, ActivityStarter.class);
PendingIntent pendingIntent0 = PendingIntent.getBroadcast(this, 0, intent0, 0);
Calendar timeOff9 = Calendar.getInstance();
timeOff9.set(Calendar.HOUR_OF_DAY, 16);
timeOff9.set(Calendar.MINUTE, 13);
timeOff9.set(Calendar.SECOND, 0);
alarmMgr0.setRepeating(AlarmManager.RTC_WAKEUP, timeOff9.getTimeInMillis(),24*60*60*1000,pendingIntent0);

助けてください。

4

1 に答える 1