Let's say there is the simplest messenger. 3 pages (fragments). Home, dialogue and dialogue. New messages come through push and tracked in the service. On each page (fragment) you need to display a notification about new messages. Question. How to implement it correctly.

    1 answer 1

    I think you should look towards the MVP pattern. When a push message is received, send message objects to the local database. And in the fragments already implement the interfaces to the database changes. If there is a new one, display as you need it.