Answer the question
In order to leave comments, you need to log in
How to dynamically read number of characters from EditText to TextVew and ProgressBar?
Just started learning Android development. I would like to know how, when entering a string in editText, the data was immediately read from it and added to the textview without any clicks.
I also wanted to know how you can also influence the progressbar by changing its progress.
Answer the question
In order to leave comments, you need to log in
editText.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) {
textVew.setText(s);
}
@Override
public void afterTextChanged(Editable s) {
}
});
Everything about real time is Rx. Specifically for the android lib RxBinding - here is a good article.
https://realm.io/news/donn-felker-reactive-android...
Of course, this is an overkill for such a task, but tasks can get more complicated, and you will already know about a good tool.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question