Created
August 13, 2024 10:38
-
-
Save anitaa1990/346e0352e31a692dad54232d6e633756 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.text.Editable | |
import android.text.TextWatcher | |
import android.widget.EditText | |
editText.addTextChangedListener(object : TextWatcher { | |
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) { | |
// Empty implementation | |
} | |
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) { | |
// In most scenarios, this is the only method we use. The other methods are often unnecessary in these cases. | |
} | |
override fun afterTextChanged(s: Editable?) { | |
// Empty implementation | |
} | |
}) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment