Answer the question
In order to leave comments, you need to log in
Why does launch affect calling a method that doesn't depend on it?
Everything works perfectly.
I remove launch, and the application just gets up.
Answer the question
In order to leave comments, you need to log in
With launch, you start the sendString() suspend method (a coroutine, basically) to run asynchronously. Since the method contains an infinite loop, by running it synchronously you prevent the program from doing anything else.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question