I am creating an app which intends to create an alarm just to wake up the user. I did not use the AlarmManager because I do not need the app to run any code or function once the alarm goes off. So, the end goal of my app is to set the phone's native alarm. For this, I used the AlarmClock class like so:
Intent intent = new Intent(AlarmClock.ACTION_SET_ALARM);
intent.putExtra(AlarmClock.EXTRA_HOUR, hour);
intent.putExtra(AlarmClock.EXTRA_MINUTES, minute);
intent.putExtra(AlarmClock.EXTRA_SKIP_UI, false);
startActivity(intent);
I would like to have the functionality to cancel the alarm. How can I access the set alarms via the app code?
Note: The alarm does not show up in the alarm clock widget on the native home screen, but appears in the native Clock application.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…