Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove textwatcher listener #19

Closed
brezinajn opened this issue Mar 14, 2017 · 2 comments
Closed

Remove textwatcher listener #19

brezinajn opened this issue Mar 14, 2017 · 2 comments

Comments

@brezinajn
Copy link

Is there any way to remove listener added by textWatcher extension function?
Thanks :)

@pawegio
Copy link
Owner

pawegio commented Mar 16, 2017

Hi @brezinajn, yes it's possible 🙂
You can access TextWatcher reference inside lambda and assign it to variable:

var textWatcher: TextWatcher? = null
textView.textWatcher {
    textWatcher = this
}
textView.removeTextChangedListener(textWatcher)

@brezinajn
Copy link
Author

Uhm, missed that one :)
Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants