I would like to know how to programmatically solve our issue. Our idea is that if the user presses home button, so the application's activity is paused, and after some time the user opens our app, he will get right to the point where he had been before he pressed the home button. For example... the user plays a game and he went through 9 levels, he presses home button, opens different apps and then he wants to go back to our application and continue the level 9, but the game loads again and he is in the beginning at level 1. We want him to continue the level 9 :)
gameLoopThread = new GameLoopThread(this);
holder = getHolder();
holder.addCallback(new SurfaceHolder.Callback() {
@Override
public void surfaceDestroyed(SurfaceHolder holder) {
boolean retry = true;
while (retry) {
try {
gameLoopThread.join();
retry = false;
} catch (InterruptedException e) {
}
}
}
@Override
public void surfaceCreated(SurfaceHolder holder) {
gameLoopThread.setRunning(true);
gameLoopThread.start();
}
@Override
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
}
});
0 comments:
Post a Comment