Everytime i am in need of having a shared data to use or to be updated in fragment, i always put the data in activity and create a method to get/update the data then access it in fragment through something like this
(activity as HomeActivity).updateData()
i feel like this is not the good way to do this, is there any better way to do this? having the same object to be accessed through different fragment
I am a newbie so any advice will be really appreciated, Thanks