Last active
May 10, 2019 21:31
-
-
Save PHELAT/87f993adb9b4330e8e96cb3a3e15b035 to your computer and use it in GitHub Desktop.
navigateUp with 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
class FragmentA : BundleFragment() { | |
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | |
super.onViewCreated(view, savedInstanceState) | |
myButton.setOnClickListener { | |
navigate(FragmentADirections.fragmentAToFragmentB(), REQUEST_CODE) | |
// If you aren't using SafeArgs plugin, you can navigate with direction id | |
navigate(R.id.fragmentAToFragmentB, REQUEST_CODE) | |
} | |
} | |
companion object { | |
const val REQUEST_CODE = 1000 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment