Duration: 14:30 min
Summary: In this lesson, we will talk about the TextWatcher. We will start with the standard application and keep the defaults. However, We will replace the content view with only the TextEdit. Then, we will attach a listener to the TextEdit and implement the TextWatcher interface. There are three methods there: beforeTextChanged, onTextChanged, and afterTextChanged. We will only provide implementation for the onTextChanged. We will set the title of the activity to the count of the letters the user is typing, and when the user reaches 10 characters, we will turn the background color of the EditText to red and disable it. Finally, we will also experiment with the PhoneNumberFormattingTextWatcher.