Android Design/Architecture: Static Reference vs Service

Suppose I have a RecyclerView in my activity A. This RecyclerView is dynamic, and it is updated whenever there’s new information (will explain more). Upon clicking an item, it takes me to another activity B. So, suppose there is new information for Activity A. I receive this information via a (Parse) notification.

While on Activity B, what means should I be using to update the RecyclerView on Activity A, assuming I want to keep it active all the time?

Currently, I have static references to the adapter, and I update the updater using this static reference from Activity B. But I feel this is not a good design/approach as static references shouldn’t be used unless extremely necessary (right?). For instance, is a Service/ServiceIntent more useful/a better approach in this case?

Thanks for any help!

Source: android

Leave a Reply