super.onPause(); \r
}\r
\r
- @Override protected void onResume () {\r
- super.onResume();\r
+ @Override protected void onResume () { \r
Gdx.app = this;\r
Gdx.input = this.getInput();\r
Gdx.audio = this.getAudio();\r
if (graphics.view instanceof android.opengl.GLSurfaceView) ((android.opengl.GLSurfaceView)graphics.view).onResume();\r
} \r
\r
- if (audio != null) \r
- audio.resume(); \r
+ if (audio != null) audio.resume(); \r
+ if(!firstResume)\r
+ graphics.resume();\r
+ else\r
+ firstResume=false;\r
+ super.onResume();\r
}\r
\r
@Override protected void onDestroy () {\r
synchronized(this) {\r
running = true;\r
}\r
- } else {\r
- app.listener.resume();\r
+ }\r
+ }\r
+ \r
+ Object synch = new Object(); \r
+ void resume () {\r
+ synchronized(synch) {\r
running = false;\r
resume = true;\r
}\r
- \r
}\r
\r
- Object synch = new Object(); \r
void pause () {\r
synchronized(synch) {\r
running = false; \r
pause = false;\r
}\r
\r
+ if (resume) {\r
+ app.listener.resume();\r
+ resume = false;\r
+ running = true;\r
+ }\r
+\r
if (destroy) {\r
app.listener.dispose();\r
destroy = false;\r