我希望 Android 闹钟响起时显示 toast 消息
我的问题是,我希望在 Android 闹钟设置为响铃时显示 toast 消息。我有 AnCal 闹钟应用程序。我已经尝试了很多,但它不起作用...我需要你的帮助...
谢谢并尊重 萨法拉兹
My question is, I want toast message to be displayed when alarm is set to rings for android..I have AnCal alarm application ..I have tried a lot but its not working ...I need your help...
Thanks and regard
Sarfaraz
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我给你一个例子,每 30 秒设置一次闹钟,当闹钟响起时,将会出现 toast,当设置闹钟时,将推送通知。如果我误解了你的问题发表评论,那么我可以删除这个答案以避免不必要的帖子。
步骤 1 MainActivity.java
步骤 2 AlarmManagerBroadcastReceiver.java
}
步骤 3NotificationReceiverActivity.java
步骤 4NotificationService.java // 这是推送通知,如果不需要通知,可以删除它
步骤 5:AndroidManifest.xml
步骤 6 Activity_main.xml
步骤7 result.xml
步骤8 运行项目
I am giving you an example that will set alarm every 30 seconds and when the alarm will ring the toast will appear and when alarm will be set notification will be pushed. If I misunderstood your question post comment so i can delete this answer to avoid UN-necessary post.
Step 1 MainActivity.java
Step 2 AlarmManagerBroadcastReceiver.java
}
Step 3 NotificationReceiverActivity.java
Step 4 NotificationService.java // this is to push notification you can remove this if you do not want notifications
Step 5 : AndroidManifest.xml
Step 6 activity_main.xml
Step 7 result.xml
Step 8 Run project