i implementing feature in application allows users set reminders @ specified time.
in reminder activity have timepicker, 2 buttons , text view. 1 button set reminder time displayed on timepicker , other cancel set reminder. when user sets reminder time @ set displayed in text view , when cancelled text view cleared.
i using alarmmanager , pendingintent trigger notificationservice @ user-specified time cant figure out way indicate reminder activity notification has been shown remove reminder time text view.
in short... when notification shown want text view empty.
you can use broadcastreceiver receive alarm, or if want receive alarm in notificationservice only, can broadcast notificationservice , listen through broadcastreceiver registered in reminder activity.
checkout broadcastreceiver tutorials:
with alarmmanager http://www.vogella.com/tutorials/androidbroadcastreceiver/article.html
with activity https://guides.codepath.com/android/starting-background-services#communicating-from-a-service-to-an-application
Comments
Post a Comment