(1)实现文本框自动搜索的功能:
et_phone为一个editText输入框控件
et_phone.addTextChangedListener(new TextWatcher() { public void onTextChanged(CharSequence s, int start, int before, int count) { if (s.length() >= 3) { String address = AddressQueryDao.numberQuery(s.toString()); tv_result.setText(address); } } public void beforeTextChanged(CharSequence s, int start, int count, int after) { } public void afterTextChanged(Editable s) { } });