Skip to content

Instantly share code, notes, and snippets.

@adfleshner
Created April 9, 2022 04:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adfleshner/794850b711c8947ed1e35124f10b1fb8 to your computer and use it in GitHub Desktop.
Save adfleshner/794850b711c8947ed1e35124f10b1fb8 to your computer and use it in GitHub Desktop.
The Good way to Pass data into a bundle
@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