Share via


AlarmClock.ActionSetAlarm Field

Definition

Activity Action: Set an alarm.

[Android.Runtime.Register("ACTION_SET_ALARM")]
public const string ActionSetAlarm;
[<Android.Runtime.Register("ACTION_SET_ALARM")>]
val mutable ActionSetAlarm : string

Field Value

Attributes

Remarks

Activity Action: Set an alarm.

Activates an existing alarm or creates a new one.

This action requests an alarm to be set for a given time of day. If no time of day is specified, an implementation should start an activity that is capable of setting an alarm (#EXTRA_SKIP_UI is ignored in this case). If a time of day is specified, and #EXTRA_SKIP_UI is true, and the alarm is not repeating, the implementation should remove this alarm after it has been dismissed. If an identical alarm exists matching all parameters, the implementation may re-use it instead of creating a new one (in this case, the alarm should not be removed after dismissal).

This action always enables the alarm.

This activity could also be started in Voice Interaction mode. The activity should check android.app.Activity#isVoiceInteraction, and if true, the implementation should report a deeplink of the created/enabled alarm using android.app.VoiceInteractor.CompleteVoiceRequest. This allows follow-on voice actions such as #ACTION_DISMISS_ALARM to dismiss the alarm that was just enabled.

<h3>Request parameters</h3> <ul> <li>#EXTRA_HOUR<em>(optional)</em>: The hour of the alarm being set. <li>#EXTRA_MINUTES<em>(optional)</em>: The minutes of the alarm being set. <li>#EXTRA_DAYS<em>(optional)</em>: Weekdays for repeating alarm. <li>#EXTRA_MESSAGE<em>(optional)</em>: A custom message for the alarm. <li>#EXTRA_RINGTONE<em>(optional)</em>: A ringtone to play with this alarm. <li>#EXTRA_VIBRATE<em>(optional)</em>: Whether or not to activate the device vibrator for this alarm. <li>#EXTRA_SKIP_UI<em>(optional)</em>: Whether or not to display an activity for setting this alarm. </ul>

Java documentation for android.provider.AlarmClock.ACTION_SET_ALARM.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to