The problem I am having right now is that when I click a button in my app, that app stays pressed down and I cannot click any other buttons, such as one to stop the thread.
Right now the app is just flashing the camera light (strobe light) and it utilizes Thread.sleep(int) when waiting for the next flash.
Is there anyway I can run this simple operation in another thread or enable the other buttons?
Thanks!
EDIT: (This is how it looks in the try catch with a new runnable thread, the try catch is throwing an error)
try{
cam = Camera.open();
Parameters p = cam.getParameters();
p.setFlashMode(Parameters.FLASH_MODE_TORCH);
cam.setParameters(p);
cam.startPreview();
new Thread(new Runnable() {
public void run() {
Thread.sleep(on);
}
}).start();
camIsOn = true;
} catch(InterruptedException ie){}