如何使用闹钟类设置闹钟

如何使用闹钟类设置闹钟

本文介绍了如何使用闹钟类设置闹钟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用AlarmClock类在应用程序中设置Alarm。我使用的代码如下:

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);

但是我遇到了一个例外。谁能告诉我如何使用这项新的Android功能?

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

推荐答案

您还需要添加

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

到您的清单。

这篇关于如何使用闹钟类设置闹钟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-01 18:22