Created
March 26, 2021 08:02
-
-
Save NezSpencer/4db0725c4b3ad27fa263754aa81c34fd to your computer and use it in GitHub Desktop.
Using the safeNavigate extension method
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
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | |
super.onViewCreated(view, savedInstanceState) | |
btn_open_screen_two.setOnClickListener { | |
findNavController().safeNavigate(FragmentOneDirections.actionFragmentOneToFragmentTwo()) | |
} | |
btn_double_click.setOnClickListener { | |
performDoubleClick() | |
} | |
} | |
private fun performDoubleClick() { | |
for (i in 1 downTo 0) { | |
btn_open_screen_two.performClick() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment