How to launch Alarm Clock screen using Intent in Android?

11,889

The following code starts an AlarmClock activity:

Intent i = new Intent(AlarmClock.ACTION_SET_ALARM); 
i.putExtra(AlarmClock.EXTRA_MESSAGE, "New Alarm"); 
i.putExtra(AlarmClock.EXTRA_HOUR, 10); 
i.putExtra(AlarmClock.EXTRA_MINUTES, 30); 
startActivity(i); 

You also need to use the following permission:

com.android.alarm.permission.SET_ALARM

See Android documentation here.

Share:
11,889
Arindam Mukherjee
Author by

Arindam Mukherjee

A Mobile app developer :By passion and by work.

Updated on June 06, 2022

Comments

  • Arindam Mukherjee
    Arindam Mukherjee almost 2 years

    In my application, i want to add alarm using my App. So i want to launch the add alarm screen of the phone directly from my App. So how to launch it using Intent?