Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set Alarm using alarm clock class

Hi I am trying to set Alarm in my application Using the AlarmClock class. I am using the code as follows:

 Intent intent = new Intent();
 intent.setAction(AlarmClock.ACTION_SET_ALARM);
 startActivity(intent);

But I am getting an exception. Can anyone please tell how to use this new Android feature?

like image 993
user519846 Avatar asked Feb 14 '11 07:02

user519846


People also ask

Can I use my laptop to set an alarm?

To launch the app, select Start and select Alarms & Clock from the app list or type its name into the search box. Alarms and timers work even if the app is closed or your device is locked.


1 Answers

You'll also need to add

<uses-permission android:name="com.android.alarm.permission.SET_ALARM"/>

to your manifest.

like image 54
barry Avatar answered Oct 12 '22 03:10

barry