@Override public void initView() { //动态监听EditText输入的内容 TextWatcher watcher = 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) { Log.d("","getUserName" } @Override public void afterTextChanged(Editable s) { } }; //searchEt(EditText控件) searchEt.addTextChangedListener(watcher); }
android-动态监听EditText输入的内容
最新推荐文章于 2023-05-04 11:39:26 发布