こんにちは、私はAndroid開発に不慣れです。notification
特定の時間にアラームを設定しているときにアラームに関連するアプリケーションを開発していますが、アラームはすべて完全に機能し、アラームは正しく通知されますが、notification
繰り返していないときにアラームが繰り返されることがあります。この問題を回避するにはどうすればよいですか.
これは私のコードです:
Intent intent = new Intent(this, AlarmReceiver.class);
intent.putExtra("ti", name);
intent.putExtra("id", id);
PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
AlarmManager alarmManager = (AlarmManager)getSystemService(Context.ALARM_SERVICE);
final Calendar cal = Calendar.getInstance();
switch(Cun.valueOf(repeat)) {
case No:
alarmManager.set(AlarmManager.RTC_WAKEUP, targetCal.getTimeInMillis(), pendingIntent);
break;
}