问题
How to read data from EditText to textview at user input without button click
回答1:
Try using textwatcher on Edittext and update textview using available methods.
TextWatcher textWatcher = 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) {
}
};
textView.addTextChangedListener(textWatcher);
回答2:
You can add a textwatcher on your edit text, and update your textview from there.
来源:https://stackoverflow.com/questions/48067033/how-to-get-edittext-value-to-textview-at-the-time-of-typing-without-button-click