I have login process like the image below:
the user will be navigated from login screen (in the middle) to change password screen (in the right) using the code below:
val changePassword = LoginUsingEmailFragmentDirections.actionToChangePasswordFragment()
Navigation.findNavController(fragmentView).navigate(changePassword)
I want if the user successfully change the password, I want to make the user back to login screen programatically.
If I use the old way navigation using a lot of activities, then I usually using finish()
I little bit confused what is the right way to achieve this. do I need to make action first in the graph and then using the similar code like above ? or is there any more convenient or better way to do this ?
You can navigate up to login screen on button click listener like below:
btn.setOnClickListener{
Navigation.findNavController(fragmentView).navigateUp()
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With