如何获得 EditText 更改? [英] How can I get EditText change?

查看:18
本文介绍了如何获得 EditText 更改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 EditText,我想在每次文本更改时通知(输入每个字符).我应该使用什么实现,应该覆盖什么功能?

I have a EditText and I want to inform each time text changes (with entering each character). What implementation should I use and what function should I override?

推荐答案

在你的 EditText 上使用 addTextChangedListener 方法并让你的类实现或定义一个实现 TextWatcher 类:

Use the addTextChangedListener method on your EditText and make your class implement or define an inner class implementing the TextWatcher class:

https://developer.android.com/reference/android/widget/TextView.html#addTextChangedListener(android.text.TextWatcher)

这篇关于如何获得 EditText 更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆