I would like to pass an object from an activity to a fragment. I know how to pass the data but do not know which type of bundle
i should use?
UPdate
In other words, I have an object of type mqttAndroidClient
and that object i want to pass from my activity to a fragment through a bundle
. Which bundle type I should use?
you should use something like this :
make your custom class that contains your desired data to be passed and
extend
fromSerializable
orParcelable
and put your object as extra to yourBundle
object and setBundle
as an argument to yourFragment
.in your
Activity
in your
Fragment