Using android alarmclock
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!
精彩评论