我只是希望用户使用 EditText 字段(或者可能是日期选择器)选择日期,然后应用程序将其存储在 SQLite 数据库中。 (我只存储该月的日期,因此每个月的特定日期(1 日、10 日、22 日等)都会弹出。)通知系统会检查该日期并显示“提醒”状态栏中的通知会在按下时将他们直接带到应用程序以更新某些信息。
基于简单教程here (在“基础知识”部分),“何时”变量决定“何时”弹出通知?如果是这样,我可以用从数据库动态生成的日期变量填充它吗?
最佳答案
The notification system comes around and checks for that date and displays a "reminder" notification in the status bar that takes them directly to the app to update certain information when pressed.
如果“通知系统”是指“我编写的应用程序”,那么这是可能的。使用AlarmManager
要在指定时间安排闹钟,请将控制路由到 BroadcastReceiver
可以创建并显示您的 Notification
.
Based on the simple tutorial here (tin "The Basics" section), is the "when" variable what decides "when" the notification pops up?
没有。它是与 Notification
关联的时间戳。用于显示目的(例如,可能出现在通知抽屉中)。
关于android - 设置状态栏通知的具体日期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10903291/