Skip to content

Instantly share code, notes, and snippets.

@hendrawd
Forked from after-ephemera/MyFragment.kt
Last active October 8, 2019 06:27
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 hendrawd/63b2edb6828233e485bf2ec42f3fb9e7 to your computer and use it in GitHub Desktop.
Save hendrawd/63b2edb6828233e485bf2ec42f3fb9e7 to your computer and use it in GitHub Desktop.
class MyFragment private constructor() : Fragment(){
companion object{
private val ARG_CAUGHT = "myFragment_caught"
fun newInstance(caught: Pokemon):MyFragment{
val args: Bundle = Bundle()
args.putSerializable(ARG_CAUGHT, caught)
val fragment = MyFragment()
fragment.arguments = args
return fragment
}
...
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment