Skip to content
Advertisement

java.lang.IllegalArgumentException: Ilegal value, when I try to pass object via bundle

I’m trying to pass an object from the class “Transfer” (java) to the class “Limit” (Kotlin), if I try to get the values ​​that come through the “Bundle” using data.name, the compiler does not give an error, but when I enter in the activity of this problem, how can I get an object via Bundle () in my intent?

JavaScript
JavaScript
JavaScript

OUTPUT WHEN I ENTER ACTIVITY:

JavaScript

Advertisement

Answer

You will need to make the class Parcelable whose object you are passing through the Bundle.

In your gradle:

JavaScript

Your data class should be like:

JavaScript
Advertisement