I am attempting to write an application that automatically sets the Android
default alarm based on some preset values determined by an alternate
algorithm.
The alarm setting works fine using the ACTION_SET_ALARM intent, however
every time I run the app, it sets a NEW alarm. I'm wondering if there is
any way to instead have one unique alarm set to update every time the
activity sets the alarm (so that there are not hundreds of new alarms in
the Android alarm application).
I will provide code excerpts if necessary, however it seems that this
question can be answered without specific examples. NOTE: I am not using
the Android alarm system that is intended for informing other activities of
certain events, but rather the actual Android alarm that users will utilize
to wake up in the morning.
Here is a code snippet that explains what I am doing:
Intent intent = new Intent(AlarmClock.ACTION_SET_ALARM);
intent.putExtra(AlarmClock.EXTRA_HOUR, time.getCurrentHour());
intent.putExtra(AlarmClock.EXTRA_MINUTES, time.getCurrentMinute());
intent.putExtra(AlarmClock.EXTRA_SKIP_UI, true);
startActivity(intent);
Thank you in advance for any assistance!
Some further attempts:
I have tried to bundle the intent Intent.ACTION_EDIT with my intent and
tried to specify the alarm local to the device, but I can't seem to find
any documentation on how one would do this. Nor do I know that this is the
way to complete my goal.
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en