In kotlin: Object class implements Serializable:
class MyClass: Serializable {
//members
}
At the point where the object sending:
val fragment = UserDetailFragment()
val bundle = Bundle()
bundle.putSerializable("key", myObject)
fragment.arguments = bundle
At the fragment, where we want to get our object:
val bundle: Bundle? = arguments
bundle?.let {
val myObject = it.getSerializable("key") as MyClass
myObject.memberName?.let { it1 -> showShortToast(it1) }
}