D
D
Dima2019-04-22 22:09:41
Java
Dima, 2019-04-22 22:09:41

Waiting for EditText result in for loop?

There is an ArrayList in which there are words. There is EditText where the user enters the same word. There is a for loop that should go through each element of the Sheet and compare it with the one written manually from the EditText field. Question: how to make it so that it would wait in a loop until the user writes a response in the EditText field?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis Zagaevsky, 2019-04-23
@NekOdin

Active waiting is bad, never do that. There is always an event to subscribe to. TextWatcher .

G
GavriKos, 2019-04-22
@GavriKos

No way - the loop should not expect anything. EDitText probably has some kind of events like OnTextChanged - subscribe to them and do what you need.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question