My app is working fine when using the data class that i'm currently using from an online exercise:
CodePudding user response:
Your new MarsProperty
class does not implement the Parcelable
interface and does not have the @Parcelize
annotation. I guess it can be an issue as the Navigation Component does not support passing such classes as destination arguments - they have to meet some requirements.
CodePudding user response:
Just implement Parcelable
and add @Parcelize
annotation.
@Parcelize
data class MarsProperty: Parcelable (
val Name: String,
val imagesURL: String,
val street: String,
val city_name: String,
val phone: String
)
Your data class must implement Serializable
or Parcelable
to pass arguments in Navigation Component.