我试图在到达日历事件的时间时让闹钟响起。我用来在到达闹钟时间时设置 AlertDialog。但是当应用程序关闭时,我需要通过警报对话框通知用户。我已经开始对扩展了 BroadCastReceiver 的 AlarmReceiver 进行 Intent 。我的代码在此链接中。 AlarmReceiver.java: http://pastebin.com/0ch5hjp9 警报.java: http://pastebin.com/bJAPAUV2 我没有收到警报,因为我曾经调用alertdialog Intent 。
当我达到 AlertDialog Intent 时,出现以下异常:
android.content.ActivityNotFoundException:无法找到显式 Activity 类 {com.android.todoapplication/android.todoapplication.Alert};您是否在 AndroidManifest.xml 中声明了此 Activity ?
最佳答案
确保您还使用 setContentView() 方法将 contentView 设置为 Activity。至少一个空的 LinearLayout。
关于java - 如何用日历闹钟解决这个问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7524296/