to top
Android APIs
public final class

AlarmClock

extends Object
java.lang.Object
   ↳ android.provider.AlarmClock

Class Overview

The AlarmClock provider contains an Intent action and extras that can be used to start an Activity to set a new alarm in an alarm clock application. Applications that wish to receive the ACTION_SET_ALARM Intent should create an activity to handle the Intent that requires the permission com.android.alarm.permission.SET_ALARM. Applications that wish to create a new alarm should use Context.startActivity() so that the user has the option of choosing which alarm clock application to use.

Summary

Constants
String ACTION_SET_ALARM Activity Action: Set an alarm.
String EXTRA_HOUR Activity Extra: The hour of the alarm being set.
String EXTRA_MESSAGE Activity Extra: Provide a custom message for the alarm.
String EXTRA_MINUTES Activity Extra: The minutes of the alarm being set.
String EXTRA_SKIP_UI Activity Extra: Optionally skip the application UI.
Public Constructors

? Examples
AlarmClock()
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String ACTION_SET_ALARM

Added in API level 9

Activity Action: Set an alarm.

Input: Nothing.

Output: Nothing.

Constant Value: "android.intent.action.SET_ALARM"

public static final String EXTRA_HOUR

Added in API level 9

Activity Extra: The hour of the alarm being set.

This value can be passed as an extra field to the Intent created with ACTION_SET_ALARM. If it is not provided, the behavior is undefined and is up to the application. The value is an integer and ranges from 0 to 23.

Constant Value: "android.intent.extra.alarm.HOUR"

public static final String EXTRA_MESSAGE

Added in API level 9

Activity Extra: Provide a custom message for the alarm.

This can be passed as an extra field in the Intent created with ACTION_SET_ALARM.

Constant Value: "android.intent.extra.alarm.MESSAGE"

public static final String EXTRA_MINUTES

Added in API level 9

Activity Extra: The minutes of the alarm being set.

This value can be passed as an extra field to the Intent created with ACTION_SET_ALARM. If it is not provided, the behavior is undefined and is up to the application. The value is an integer and ranges from 0 to 59.

Constant Value: "android.intent.extra.alarm.MINUTES"

public static final String EXTRA_SKIP_UI

Added in API level 11

Activity Extra: Optionally skip the application UI.

This value can be passed as an extra field to the Intent created with ACTION_SET_ALARM. If true, the application is asked to bypass any intermediate UI and instead pop a toast indicating the result then finish the Activity. If false, the application may display intermediate UI like a confirmation dialog or alarm settings. The default is false.

Constant Value: "android.intent.extra.alarm.SKIP_UI"

Public Constructors

public AlarmClock ()

Added in API level 9

No examples for this method.
Frequently called with: [Clear]
Portions of this page are reproduced from work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. The original page is available here.