L
L
leo97972017-04-11 16:59:50
Android
leo9797, 2017-04-11 16:59:50

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

2 answer(s)
G
geron, 2017-04-11
@leo9797

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) {

            }
        });

S
Sergey Vashchenko, 2017-04-17
@Simipa

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 question

Ask a Question

731 491 924 answers to any question