There is a class for the stream, the code from the cash register constructor always works, and run () is run once, what could be the reason? The log is empty.
public class SThread extends Thread { Thread ScoreThread; public SThread() { ScoreThread = new Thread(this); ScoreThread.start(); } public void run() { while(running) { if(!onDraw)return; try{Thread.sleep(500);}catch (InterruptedException e){e.printStackTrace();} score++; text = "Score: "+score; } } }
I call like this
new SThread();