Code:
Thread cameraThread = new Thread()
{
public void run()
{
//camera code goes here
}
};
Then do...
Code:
cameraThread.sleep(timeInMillis);
or
Code:
cameraThread.stop(); //not sure if this is depreciated
java.util.Timer myTimer = new java.util.Timer();
myTimer.schedule(new TimerTask()
{
@Override
public void run()
{
cameraThread.run();
}
}, 1000);
The difference between this and sleeping the thread is that the timer doesn't suspend the run-time of the program. I'm thinking that this is what you are looking for.