Last active
April 9, 2022 04:20
-
-
Save adfleshner/7eeb5ce55b7dcca1c201d0fe4a4edbe9 to your computer and use it in GitHub Desktop.
The Easy way you can 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
data class User(val name:String, val age:Int) : Serializable | |
... | |
//Now you can add it as a single line into the bundle. | |
val b2 = Bundle().apply{ | |
putSerializable("user",User(name, age)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment