# Update UI With Observer

Sometimes I need to update UI from different Fragments. But it seems that writing update method in each Fragment is absurd if I have a lot of Fragment to handle with.

Here is a better solution by using Observer pattern, IMO.

### Sample

1. Define an EventObject, which is a event(or message) will be passed to Observer.
1. Define an Observable, which will dispatch event or message to Observer.
1. Caller. Use a shared instance of Observable to dispatch event to Observer.
1. Receiver, which implements Observer interface.