I have a simple thread like this.
public class CameraThread extends Thread {
private AtomicBoolean runCamera; public CameraThread(AtomicBoolea