'set up alarm clock for a future date/android studio
Im trying to set an alarm clock for a future date but I don´t know hot to set a month and a day of the month, upto now i found out how to set it for a day of the week using te code you see bellow, I would like to know how to change the days of the week for a future dates using this same code.
values= new ArrayList<>();
*values.add(calendar.SUNDAY);
values.add(calendar.MONDAY);
values.add(calendar.THURSDAY);
alarma.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent= new Intent(AlarmClock.ACTION_SET_ALARM)
.putExtra(AlarmClock.EXTRA_MESSAGE,"Gerson")
.putExtra(AlarmClock.EXTRA_HOUR ,20)
.putExtra(AlarmClock.EXTRA_MINUTES,33)
.putExtra(AlarmClock.EXTRA_DAYS,values);
if (intent.resolveActivity(getPackageManager())!=null){
startActivity(intent);
}
}
});
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
