Author Topic: GLSurfaceView + onPause  (Read 2181 times)

Offline Andrey8000

  • byte
  • *
  • Posts: 13
    • View Profile
GLSurfaceView + onPause
« on: July 30, 2013, 01:48:49 pm »
Hello. I try to finish activity in "onPause" when i lock my device:
Code: [Select]
public void onPause() {
mGLView.onPause();
mGLView = null;
gameRunning = false;
running = false;
paused = true;
renderer = null;
handler = null;
handlerTimer = null;
workThread = null;
mWorld.world.removeAll();
mWorld.world = null;
mWorld = null;
fb = null;
workThread = null;
gd = null;
mec = null;
MyGame.this.finish();
super.onPause();
}
But until i unlock device it's no "onStop" and "onDestroy" in Logcat, only this orange text:
Quote
... IInputConnectionWrapper(19178): getExtractedText on inactive InputConnection

After that I have to wait a few seconds, then again I see my game screen and only then the activity is completed...

Why the activity is not complete immediately, as in the method "finish()" without blocking device?
« Last Edit: July 30, 2013, 01:51:08 pm by Andrey8000 »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: GLSurfaceView + onPause
« Reply #1 on: July 30, 2013, 08:56:52 pm »
I'm not sure what your actual question is here...if you want to end the Activity in onPause, just do System.exit(0); It's not the nice way to exit, but it works.

Offline Andrey8000

  • byte
  • *
  • Posts: 13
    • View Profile
Re: GLSurfaceView + onPause
« Reply #2 on: July 31, 2013, 09:06:20 am »
Yes, "System.exit(0);" works right, but again there is no "onStop" and "onDestroy" metods called after "onPause" =/
Well, now I went the other way and it is not important. Thank you.