Problem with threads and camera.
Hi everybody!
I've a problem with taking snapshot.
I would like to display a loading screen after it take snapshot ( sometimes i
have to wait few seconds after i took snapshot. Propably photo is being taken in time where i have to wait).
I was trying to use threads but i didn't succeed.
I made this code:
display.setCurrent(perform);
new Thread(new Runnable(){
publicvoid run(){
while((!performing.isShown()) && (backgroundCamera.isShown())){
Thread.yield();
}
notifyAll();
}
}).start();
new Thread(new Runnable(){
publicvoid run(){
try{
this.wait();
}catch(Exception e){
exceptionHandler(e);
}
photo = camera.snapshot();
display.setCurrent(displayPhoto);
}
}).start();
This code is sometimes showing performing screen but sometimes no.
I don't know why. In my opinion performing.isShown() method isn't working correctly.
Does anyone have some idea how to use threads here?

