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?
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.
You'll also need to add
<uses-permission android:name="com.android.alarm.permission.SET_ALARM"/>
to your manifest.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With