v0.6.2e: fixed bad changes made to app lifecycle managment

This commit is contained in:
Evan Debenham
2017-11-19 02:21:41 -05:00
committed by Evan Debenham
parent 5c087e72aa
commit aa88bf7d23
6 changed files with 20 additions and 17 deletions

View File

@@ -149,13 +149,13 @@ public class Game extends Activity implements GLSurfaceView.Renderer, View.OnTou
private boolean paused;
//Checks for gingerbread are here due to minor activity lifecycle differences
//Starting with honeycomb, android's lifecycle management changes slightly
@Override
public void onStart() {
super.onStart();
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.GINGERBREAD_MR1){
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB){
resumeGame();
}
}
@@ -164,7 +164,11 @@ public class Game extends Activity implements GLSurfaceView.Renderer, View.OnTou
protected void onResume() {
super.onResume();
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.GINGERBREAD_MR1){
if (scene != null) {
scene.onResume();
}
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB){
resumeGame();
}
}
@@ -174,10 +178,10 @@ public class Game extends Activity implements GLSurfaceView.Renderer, View.OnTou
super.onPause();
if (scene != null) {
scene.onFocusLost();
scene.onPause();
}
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.GINGERBREAD_MR1){
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB){
pauseGame();
}
}
@@ -186,7 +190,7 @@ public class Game extends Activity implements GLSurfaceView.Renderer, View.OnTou
public void onStop() {
super.onStop();
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.GINGERBREAD_MR1){
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB){
pauseGame();
}
}
@@ -213,11 +217,6 @@ public class Game extends Activity implements GLSurfaceView.Renderer, View.OnTou
Sample.INSTANCE.resume();
}
public static void quitGame(){
Game.instance.finish();
System.exit(0);
}
public boolean isPaused(){
return paused;
}