Change app UI from notification action in android -


i working on to-do list android app has feature of users being able set reminders shown in notification bar. notification contains "completed" action associated it. when action pressed, makes changes sql lite database. works fine if app closed. if app still open , press on notification action, ui doesnt change automatically. have close app , start again see changed data. there way cause activity reload in way reflect changes if activity open.

there several solutions:

  1. use dataprovider , call context.getcontentresolver().notifychange() notify observers new data appropriate uri
  2. use localbroadcastmanager register receiver in activity , later notify changes.
  3. use non standard methods of notifying updated data. instance otto

so, recommend read observer pattern because solutions it.


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -