-1
私はAlarmManagerを使用してアラームを設定し、timePickerから時刻を渡しました。直近のアラームトリガー
私はアラームを所定の時間に設定したいが、時間(設定しようとしているもの)が経過していれば、アラームはにすぐにをトリガーする。
例: - 現在の時刻が午後9時で、午後7時にアラームを設定すると、アラームがすぐにトリガーされます。以下は
は私のコードでは、我々は、アラームを設定しているため時間が経過した場合、アラームのトリガを制御する方法
public void startAlarm(Calendar c, int id){
Toast.makeText(this, "Alarm in on", Toast.LENGTH_SHORT).show();
Intent intent = new Intent(this,AlarmReciever.class);
intent.putExtra("id",id);
//int _id = (int)System.currentTimeMillis();
PendingIntent pendingIntent = PendingIntent.getBroadcast(this,id,intent,PendingIntent.FLAG_ONE_SHOT);
alarmManager = (AlarmManager)getSystemService(ALARM_SERVICE);
alarmManager.setRepeating(AlarmManager.RTC_WAKEUP,c.getTimeInMillis(), 1000*60,pendingIntent);
//alarmManager.set(AlarmManager.RTC_WAKEUP,c.getTimeInMillis(),pendingIntent);
}
のですか?