background: There is a name for what gang of four; four us it Daniel; I don't know; the 23 design patterns are summarized, and the solution to the problem in programming ;solve the problem: when the target or data changes, the Observer (interface) to display the notification;observer pattern;concept: When an object changes, all objects that depend on it are automatically changed accordingly.
I am here to give an example of a journey to the city;
The observed: Tang's monk;The Observer, the Wukong, the Sand monk, the eight commandments;Monsters;when Master Tang's monk is caught by the monster, the Observer, Goku, the Sand monk, the eight precepts, will find; and respond;
give an example of a program again; We query the database and display it with a ListView, and when the contents of the database change, and the ListView updates the display information; hehe; it's just my personal understanding; not on behalf of the public .
can also look at the picture to understand;
An explanation of the viewer mode in Android design mode