GLSurfaceView + onPause

Started by Andrey8000, July 30, 2013, 01:48:49 PM

Previous topic - Next topic

Andrey8000

Hello. I try to finish activity in "onPause" when i lock my device:

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?

EgonOlsen

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.

Andrey8000

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.