开发者

Using android alarmclock

开发者 https://www.devze.com 2022-12-27 08:15 出处:网络
Is it possible to use the com.android.alarmclock so that I can use it to ki开发者_如何学Cck off alarm features in my application?If it is how can i do it?Since API level 9 you can set the AlarmClock b

Is it possible to use the com.android.alarmclock so that I can use it to ki开发者_如何学Cck off alarm features in my application? If it is how can i do it?


Since API level 9 you can set the AlarmClock by creating an intent like the following:

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


The service you need is the AlarmManager.


No the AlarmManager is not going to set off a Alarm!

0

精彩评论

暂无评论...
验证码 换一张
取 消