設置輸入框文本監聽

etCommonInput.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) {
        number = etCommonInput.getText().toString().trim();
        if (!TextUtils.isEmpty(number)) {
            address = AdressDao.getAddress(CommonNumberQuery.this, number);
            tvBlong.setText(address);
        }
    }
});
相關文章
相關標籤/搜索