Force Close when opening an application after pressing the home button

I have a game that has a surface view and runs on stream. if I press the "HOME" button when the game is playing, and then I re-open the game through the icon, I get the power. what is the problem?

0
android
Mar 10 2018-11-11T00:
source share
1 answer

Are you starting your Thread with thread.start() in a surfaceCreated ? If so, there will always be an error if you do not use a member variable that contains a check to see if your game was running.

You need to “pause” your Thread in the surfaceDestroyed using the wait() command so that it does not repeat your game code during a pause. The next time you launch your application (for the first time or, possibly, the second time), you need to start() it or notify() it (after a pause) depending on the circumstances.

Finally, always always send the code. This will allow people to correctly and correctly answer the question.

+9
Mar 10 '11 at 7:20
source share



All Articles