samedi 2 avril 2016

Android best practises: sharing data between fragments in viwpager

The case: I use guide from androidhive to implement two tabs that by one activity. First one - list with complex objects in recyclerview, second - map with elements from this list. As DB I use SQLite but I'm going to migrate on nice and cozy Realm.

In SQLite case general approach which looks appropriate is to make list item object Parcelable and then use bundle to transfer data from activity to fragments. One call to the database, seems legit.

But in case of Realm I cannot use Parcelable because it requires getters/setters methods only.

What is the best way in this case?

Aucun commentaire:

Enregistrer un commentaire