1

我已经实现了示例应用程序来获取通知。我想在用户输入时间和系统时间相等时显示通知,然后通知应该出现并且也像提醒一样出现在暂停中。这里我使用了数字时钟,我可以能够看到它正在运行的数字时钟时间。当用户时间和系统时间相等时,通知不显示。

我写的代码如下

             //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
                 }  

当用户时间和系统时间等于提醒时,它不会显示任何通知。

我怎样才能显示通知仍然 systime 和 usertime 像提醒通知一样相等?

请任何人帮助我

提前致谢

4

1 回答 1

2

您可能应该使用 AlarmManager 来安排通知。

于 2011-06-17T07:00:08.267 回答