如何像提醒一样显示通知?
我已经实现了示例应用程序来获取通知。我想在用户输入时间和系统时间相等时显示通知,然后通知应该出现,并且也会像提醒一样在暂停时出现。在这里我使用了数字时钟,我可以能够看到正在运行的数字时钟时间。当用户时间和系统时间相等时,不会显示通知。
我编写的代码如下,
//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
}
当用户时间和系统时间等于提醒时,它不会显示任何通知。
我怎样才能像提醒通知一样显示系统时间和用户时间相同的通知?
请任何人帮助我
提前致谢
i have implemented sample application to get the notification.i would like to display a notification when user entered a time and system time are equal then the notification should appear and also appear in on pause like reminder.Here i have used digital clock,i can able to see digital clock time it is running.when the user time and system time are equal that notification is not displaying.
i have written code as follows
//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
}
it is not displaying any notification when usertime and systime are equals like reminder.
how can i display notification still the systime and usertime are equal like reminder notification?
please any body help me
thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能应该使用 AlarmManager 来安排通知。
You should probably use AlarmManager to schedule notification.