I have added a new action Navigation.xml
:
<fragment
android:id="@+id/launcher_home"
android:name="com.example.android.codelabs.navigation.MainFragment"
android:label="@string/home"
tools:layout="@layout/main_fragment">
<action
android:id="@+id/go_to_step_one"
app:destination="@id/flow_step_one" />
</fragment>
When calling the navigation action, if i use, the navigation works correctly :
view.findViewById<Button>(R.id.navigate_action_bt)?.setOnClickListener(
Navigation.createNavigateOnClickListener(R.id.go_to_step_one, null)
)
But when calling it with a lambda, it does not work :
view.findViewById<Button>(R.id.navigate_action_bt)?.setOnClickListener {
Navigation.createNavigateOnClickListener(R.id.go_to_step_one, null)
}