[MDC-101] Should use TextWatcher instead of OnKeyListener for listening to text changes inside EditText
kdb13 opened this issue · 0 comments
kdb13 commented
Describe the bug
In MDC-101, when the password text field is being listened for text changes, the codelab is using an OnKeyListener
, which should not be used as its documentation says that it will only detect hardware key presses and not software key presses.
Although it works in some cases, it might not always for every device.
To Reproduce
Steps to reproduce the behavior:
- Go to https://codelabs.developers.google.com/codelabs/mdc-101-java/#4
- Click on `Step 5 - Navigate to the next fragment'
- Scroll down to LoginFragment.java and see the implementation of
onCreateView()
- See that an
OnKeyListener
is being set topasswordEditText
.
Expected behavior
The implementation should be TextWatcher
instead of OnKeyListener
.
Codelab details (please complete the following information about the codelab):
- Level (MDC-101)
- Language (Java)
- Link to the codelab at the step with the issue (ex: https://codelabs.developers.google.com/codelabs/mdc-101-java/#4)