I have application that needs to show notification in status bar. I have to set time and date in my app, and on that time and date notification needs to be shown in status bar as somekind of reminder.

I've tried this tutorial, but scheduled event isn't triggered at all.

Is there a way to do this?

有帮助吗?

解决方案

I suggest that you use AlarmManager in connection with a SQL database to handle notifications. You could use AlarmManager to schedule alarms which are fetched from your database. You should use a BroadcastReceiver to add alarms when the phone boots in order to handle the situation where the phone is rebooted by the user or system failure.

This howto explains how to use the AlarmManager.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top