Android Design/Architecture: Static Reference vs Service -


suppose have recyclerview in activity a. recyclerview dynamic, , updated whenever there's new information (will explain more). upon clicking item, takes me activity b. so, suppose there new information activity a. receive information via (parse) notification.

while on activity b, means should using update recyclerview on activity a, assuming want keep active time?

currently, have static references adapter, , update updater using static reference activity b. feel not design/approach static references shouldn't used unless extremely necessary (right?). instance, service/serviceintent more useful/a better approach in case?

thanks help!

static reference vs service

aside comparing apples bananas, doing wrong static reference, leading memory leak (try using leakcanary...). should use eventbus (like greenrobot's, otto) distribute data various components of application.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -