我想TextWatcher为多个EditText字段实现接口。目前我正在使用:
text1.addTextChangedListener(this);
text2.addTextChangedListener(this);
然后覆盖我的Activity中的方法:
public void afterTextChanged(Editable s) {}
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
public void onTextChanged(CharSequence s, int start, int before, int count)
{
// do some operation on text of text1 field
// do some operation on text of text2 field
}
但这工作正常,但我正在寻找其他方法,以便可以明确确定当前关注的EditText领域SoftKeyboard。
尚方宝剑之说
相关分类