Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialSlava Fleer
6,086 PointsHow to scan for any text in EditText not just OnClick ? (Extra Credit Task)
Hi. I am trying to do the Extra Task for messenger. What I want is to add Send Icon in Action Bar when and only when the EditText is field with some text and removed if I deleting the text.
I tried with OnClickListener but it as said checking with click, so when I removing text , the change would be only on next click. I tried with onEditorAction , but with no luck, probably it for something else.
So if someone know how to do it, I would glad for answers =)
1 Answer
Ratik Sharma
32,885 PointsWhat you're looking for is a TextWatcher. Here is some relevant documentation/examples:
Slava Fleer
6,086 PointsSlava Fleer
6,086 Pointsthanks. I would check it.
Slava Fleer
6,086 PointsSlava Fleer
6,086 PointsYep. It does the magic =). Thanks again. Nice method, must know it everyone for mine opinion.