‫Hello, friends.
‫So this lesson, we're going to write some code to reset the password, let's say that the user forgets
‫the password because that's never happened to me.
‫All right.
‫So let's open Android studio.
‫And before we start writing code, let's hide the passwords written by the user and the edit text components
‫to open the design files.
‫All right.
‫Well, here I'm changing the input type properties of the edit text components.
‫OK, so now we can do the password reset.
‫So for that, I can just open the forget activity.
‫I'll create an object from the firebase authentication class.
‫I defined the off object in the uncreate method.
‫And now I will create a new method.
‫So I've got to write the email address of the user as a parameter.
‫All right, off dot, send password reset.
‫Email.
‫I write the email object and princess, I write that add on complete listener.
‫If the process is successful.
‫We can show a toast message.
‫So now let's define this method in the unclick listener.
‫And I'm transferring the user's email address to a string type variable.
‫Here we can create an infrastructure.
‫All right, my friends, that pretty much is the password reset process, so Firebase will send a reset
‫link to the user's email address.
‫When the user clicks on the link, they will be asked to create a new password.
‫Go ahead, test it out yourself.
‫There is one more thing we'll need to do.
‫If the user has created an account and exited the application without logging of main activity should
‫be opened instead of log in activity when they re-enter the application.
‫Right.
‫So for this, I'll just open the login activity.
‫I'll create an object from the firebase user class.
‫Although find a new firebase user object in the on start method.
‫And I'm going to create an IV structure if the firebase user object is not null.
‫That is if the user account has been created.
‫I opened the main activity using intent.
‫All right, let's run that and test to see how it works.
‫So as you can see, the main activity has been opened instead of the log in activity because there was
‫an account that we created earlier.
‫Well done.
‫We'll take a break here.
‫And in the next lesson, we're going to add an options menu to the main activity.
‫I'll see you in the next lesson.