I want when I click @button to check if there is an '@' sign in EditText @email and if EditText @password and @password2 have identical text.
I know that I can use the TextWatcher to check if a given character exists, but I don't know how it works.
So let us break the task; in order to see if the
@symbol is present in the text, you can do the following:Now in order to see if password edit texts have the same text, we can do the following:
So we can combine everything when the user click on your button like that:
You don't have to use
TextWatcherwhen you want to handle only click events, but if you want to make continuous observing of the EditText, then you should use it!