Hello to all. I am writing a small interpreter in which there are several functions, including the sleep () function, as well as a TextView, which serves as the log role. For example, there is a code for the interpreter:
printline("test") // пишет в лог текст sleep(1000) // "спит" секунду The execution looks like this: The lineWorker method starts, which in turn twists the code. The problem is that EditText will be updated only when the program ends and the lineWorker method stops (in this case, the word test will be displayed only after a second). But it is necessary that the interface be updated with each function worked out in lines of code. How to get out of this situation?
Thread.sleep(long millis)? - FlippyThread/Handler? - Flippy