Reputation: 1
I have a problem with my app. I have a SurfaceHolder for drawing onto a canvas.
Under the surfaceCreated method, I call thread.start()
;
Under the surfaceDestroyed method, I call thread.join()
;
I run my app and press the home key, whoch in turn invokes the surfaceDestroyed
method.
The problem is that I get a thread already started exception when I subsequently try and run my app again. Why is this? I am even testing to see if the thread is already running using isAlive()
. Do I need to replace the thread.join
line with a thread.wait
?
If so, how can I resume the thread instead of starting it again in surfaceCreated
?
Upvotes: 0
Views: 974