Android 如何像提醒一样显示通知?
我已经实现了示例应用程序来获取通知。我想在用户输入的时间和系统时间相等时显示通知,然后通知应该会出现,也会像提醒一样出现在暂停中。这里我使用了数字时钟,我可以看到它正在运行的数字时钟时间。当用户时间和系统时间相等时,不会显示通知 我已经编写了如下代码Android 如何像提醒一样显示通知?,android,notifications,reminders,Android,Notifications,Reminders,我已经实现了示例应用程序来获取通知。我想在用户输入的时间和系统时间相等时显示通知,然后通知应该会出现,也会像提醒一样出现在暂停中。这里我使用了数字时钟,我可以看到它正在运行的数字时钟时间。当用户时间和系统时间相等时,不会显示通知 我已经编写了如下代码 //This is for get the system time DateFormat df = DateFormat.getTimeInstance(); systime =
//This is for get the system time
DateFormat df = DateFormat.getTimeInstance();
systime = df.format(new Date());// system time formate is :HH:MM:SS
//thi is for user entered data
usertime="HH:MM:SS";
if(systime.equals(usertime))
{
notify(); //calling notify method to get the notification
}
当用户时间和系统时间等于提醒时,它不会显示任何通知
如果系统时间和用户时间与提醒通知相同,如何显示通知
请任何人帮帮我
提前感谢您可能应该使用AlarmManager来安排通知时间。您可以提供关于使用AlarmManager的示例应用程序吗?我可以接受,但可以提供一些示例代码吗?编写了一个教程。通知提醒: