android-kotlin-login-navigation icon indicating copy to clipboard operation
android-kotlin-login-navigation copied to clipboard

Advanced Android in Kotlin: Login 6.2 [Step #][description]

Open shalperin opened this issue 6 years ago • 1 comments

Step 6 Code sample for MainFragment.kt reads:

binding.settingsBtn.setOnClickListener {
   val action = MainFragmentDirections.actionMainFragmentToSettingsFragment()
   findNavController().navigate(action)
}

MainFragmentDirections is not a thing in this project. Perhaps you mean: findNavController().navigate(R.id.action_mainFragment_to_settingsFragment)

codelab: advanced-android-kotlin

shalperin avatar Mar 29 '20 17:03 shalperin

Safe Args plugin is missing in the starter project and that is why MainFragmentDirections is not defined. You can modify build.gradle files to include the plugin (see also https://github.com/googlecodelabs/android-kotlin-login-navigation/issues/7). But your solution is even better and simpler.

It is sad that these codelabs are full of bugs which remains unfixed for months or years :-(

holecekp avatar Jun 29 '21 19:06 holecekp