I\'m coding a radio in java and am using a thread to of course play the stream in. I have a while loop in the run method of the thread which checks if a variable called shou
add 'volatile' will fix it
private volatile boolean shouldPlay = true;