アラームを設定できるアプリを作っています。実際には機能しますが、一度だけです。そして、私は複数回行う必要があります.imクラススケジュールアラームを実行しようとしています.
たとえば、月曜日の授業は 7 時なので、毎週月曜日にアラームを開始する必要があります。でも、火曜日に別のクラスがあり、同じことをしなければなりません。
これが動作する私のコードです pd-> rqs1 = 1
Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(System.currentTimeMillis());
cal.set(Calendar.HOUR_OF_DAY, horai); // i put the hour with the interface
cal.set(Calendar.MINUTE,minutoi);///
cal.set(Calendar.DAY_OF_WEEK,dias.getSelectedItemPosition()+1);
cal.add(Calendar.SECOND, 2);
Intent intent = new Intent(getBaseContext(), AlarmReceiver.class);
intent.putExtra("name", curso); // i put the name of the curso
PendingIntent pendingIntent =
PendingIntent.getBroadcast(getBaseContext(),
RQS_1, intent, PendingIntent.FLAG_ONE_SHOT);
AlarmManager alarmManager =
(AlarmManager)getSystemService(Context.ALARM_SERVICE);
alarmManager.setRepeating(AlarmManager.RTC_WAKEUP,
cal.getTimeInMillis(), 24 * 7 * 60 * 60 * 1000 , pendingIntent);`
だから、私はそれを行う方法を探してきました。私を助けてください 。ありがとう