505_TextWatcher可以重复添加
生活随笔
收集整理的這篇文章主要介紹了
505_TextWatcher可以重复添加
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
TextWatcher可以重復(fù)添加
EditText et = (EditText) findViewById(R.id.et);
? ? ? ? et.addTextChangedListener(new TextWatcher() {
? ? ? ? ? ? @Override
? ? ? ? ? ? public void beforeTextChanged(CharSequence s, int start, int count, int after) {
? ? ? ? ? ? }
? ? ? ? ? ? @Override
? ? ? ? ? ? public void onTextChanged(CharSequence s, int start, int before, int count) {
? ? ? ? ? ? }
? ? ? ? ? ? @Override
? ? ? ? ? ? public void afterTextChanged(Editable s) {
? ? ? ? ? ? ? ? str = str + "2";
? ? ? ? ? ? ? ? showToast(str);
? ? ? ? ? ? }
? ? ? ? });
? ? ? ? et.addTextChangedListener(new TextWatcher() {
? ? ? ? ? ? @Override
? ? ? ? ? ? public void beforeTextChanged(CharSequence s, int start, int count, int after) {
? ? ? ? ? ? }
? ? ? ? ? ? @Override
? ? ? ? ? ? public void onTextChanged(CharSequence s, int start, int before, int count) {
? ? ? ? ? ? }
? ? ? ? ? ? @Override
? ? ? ? ? ? public void afterTextChanged(Editable s) {
? ? ? ? ? ? ? ? str = str + "a";
? ? ? ? ? ? ? ? showToast(str);
? ? ? ? ? ? }
? ? ? ? });
總結(jié)
以上是生活随笔為你收集整理的505_TextWatcher可以重复添加的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 语音压缩编解码器:lyra
- 下一篇: [css] 使用sass的方式有哪些?