I have 2 buttons in the program. Pause and Start. How to make it so that it was possible to stop a stream using the pause button. let's say
Thread. And on the Start button, continue the flow.
But so that the main thread is not frozen.
If Thread is not suitable for this operation. What should I use then?