【问题标题】:addTextChangedListener get EditText dynamicallyaddTextChangedListener 动态获取 EditText
【发布时间】:2012-09-06 00:20:16
【问题描述】:

我有动态生成并动态添加 addTextChangedListeners 的 EditTexts 向量。

问题是“afterTextChanged”上返回的 Editable 不会让我知道此侦听器与哪个 EditText 关联。

有没有办法从 TextWatcher 中调用相应的 EditText?

谢谢,

【问题讨论】:

    标签: android android-edittext textwatcher


    【解决方案1】:

    我建议创建您自己的 TextWatcher,但在我将未经测试的伪代码放在这里之前,我发现另一个名叫 Sebastian Roth 的人已经这样做了。

    看看他的回答: TextWatcher for more than one EditText

    【讨论】:

    • 谢谢,我没有想到那个选项……也谢谢你的代码。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-07-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多