Created
April 9, 2022 04:40
-
-
Save adfleshner/794850b711c8947ed1e35124f10b1fb8 to your computer and use it in GitHub Desktop.
The Good way to Pass data into a bundle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Parcelize | |
data class User(val name:String, val age:Int) : Parcelable | |
//now you will use putParcelable to add it to the bundle | |
val b3 = Bundle().apply { | |
putParcelable("user",User(name, age)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment