TextWatcher参数理解
2014-11-09 00:39
316 查看
class MyTextWatcher implements TextWatcher{ @Override public void afterTextChanged(Editable s) { // s是文本改变后的内容 Log.i("afterTextChanged", "afterTextChanged the text's length is "+etTest.length()); Log.i("afterTextChanged", "afterTextChanged the s is "+s.toString()); Log.i("afterTextChanged", "-------------------------------------"); } @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { // s是文本改变前的内容 // start是文本改变操作后输入光标所在位置 // count删除内容时是删除字符的个数,增加内容时为0 // after增加内容时是增加字符的个数,删除内容时为0 // 通过组件索引获得的text内容是改变前的 Log.i("beforeTextChanged", "beforeTextChanged the text's content is "+etTest.getText().toString()); Log.i("beforeTextChanged", "beforeTextChanged the text's length is "+etTest.length()); Log.i("beforeTextChanged", "beforeTextChanged the s is "+s); Log.i("beforeTextChanged", "beforeTextChanged the start is "+start); Log.i("beforeTextChanged", "beforeTextChanged the count is "+count); Log.i("beforeTextChanged", "beforeTextChanged the after is "+after); Log.i("beforeTextChanged", "-------------------------------------"); } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { // s是文本改变后的内容 // start是文本改变操作后输入光标所在位置 // count增加内容时是增加字符的个数,删除内容时为0 // after删除内容时是删除字符的个数,增加内容时为0 // 通过组件索引获得的text内容是改变后的 Log.i("onTextChanged", "onTextChanged the text's content is "+etTest.getText().toString()); Log.i("onTextChanged", "onTextChanged the text's length is "+etTest.length()); Log.i("onTextChanged", "onTextChanged the s is "+s); Log.i("onTextChanged", "onTextChanged the start is "+start); Log.i("onTextChanged", "onTextChanged the before is "+before); Log.i("onTextChanged", "onTextChanged the count is "+count); Log.i("onTextChanged", "-------------------------------------"); } }
相关文章推荐
- TextWatcher参数理解
- 最强理解:Android对EditText输入时设置监听即TextWatcher的用法
- Android EditText TextWatcher 回调方法参数说明
- TextWatcher接口中方法参数说明
- TextWatcher 参数详解
- Android EditText的TextWatcher监听回调参数详解
- TextWatcher中的参数
- Activex 一控件如何对参数处理 ,新手 上班第一天接到这东西看不懂不理解
- 理解 Delphi 的类(十) - 深入方法[3] - 调用时参数分割
- 用”堆栈区数据复制”理解Java赋值和参数传递机制的心得
- 理解 Delphi 的类(十) - 深入方法[22] - 指针参数
- 充分理解java中的参数传递~!
- configure参数的理解
- 理解 Delphi 的类(十) - 深入方法[29] - 传址参数不能赋予常量
- 帮助理解可变参数的应用【转贴】
- 理解 Delphi 的类(十) - 深入方法[11] - 参数前缀
- 理解 Delphi 的类(十) - 深入方法[21] - 开放数组参数
- 参数化操作中参数类型为Data File 和Table时,对一些Update方式设置的理解
- size_t,__T,_T,TEXT,_TEXT等一些特殊宏的理解
- 理解button的Click事件和TextBox的TextChanged\DropDownList.SelectedIndexChanged的实现原理的区别