I’m writing a simple XMPP Client in android, I’ve extracted all the XMPP Calls to a nice helper module. That module writes any incoming XMPP Messages to a SQLite database.
When the app opens a view of a user, it grabs a copy of the latest messages from the SQLite db (easy enough).
However if a XMPP Message was to come in whilst the user is viewing that “ListView” is there anyway bubble a message down a tree to tell a view to update?
The XMPP Client is run in the Application context if that helps at all.
Use ContentProvider and ContentObserver, its a good implementation of the observer pattern, which is exactly what you need. The Adapter providing the content to the ListView even handles practically all of the observation side, you’ll just need to implement your own ContentProvider