週アラームの設定された繰り返し日のために誰かが良いロジックを与えることができますか?私は毎週行っているアラームを使用してアンドロイドで週アラームの繰り返しの日を設定する
alarmCalendar.set(Calendar.HOUR, AlarmHrsInInt);
alarmCalendar.set(Calendar.MINUTE, AlarmMinsInInt);
alarmCalendar.set(Calendar.SECOND, 0);
alarmCalendar.set(Calendar.AM_PM, amorpm);
Long alarmTime = alarmCalendar.getTimeInMillis();
Intent intent = new Intent(Alarm.this, AlarmReciever.class);
intent.putExtra("keyValue", key);
PendingIntent pi = PendingIntent.getBroadcast(Alarm.this, key, intent, PendingIntent.FLAG_UPDATE_CURRENT);
am.setRepeating(AlarmManager.RTC_WAKEUP, alarmTime, 7*1440*60000 , pi);
アラームトリガーは、時間と7日後に自動的にその時にトリガーします。
しかし私の要件は、ちょうど7日ではなく日を選択したいということです。
毎週月曜日、火曜日、木曜日午前9:00のようなもの - アラームは自動的にトリガーされるはずです。 setRepeatingでこれをどうやって行うのですか?
誰かがこれで私を助けることができますか?
ありがとうございます!
あなたは、私は別の警報の日に別のIDを設定する必要が言うことを意味します。しかし、setRepeatingでtriggerAtMillisの部分を設定する方法。 たとえば今日は火曜日ですが、私は毎週月曜日、水曜日、金曜日を選択します。 - 水曜日のトリガーは、現在の時刻から1日何を置くのですか? – TheDevMan
アラームごとに異なるIDです。あなたの第2部については、更新された答えを見てください。 –
@Shobit Puri週日以上にアラームを設定したいのですが、毎週水曜日、水曜日のように毎週設定する方法があります。トリガ時間を7日に設定した場合、次の日が火曜日の場合、それは動作しません。手伝ってくれますか? – moDev