How to stop an activity with GL view. Application not responding

Posted by David on Stack Overflow See other posts from Stack Overflow or by David
Published on 2010-03-17T22:19:01Z Indexed on 2010/03/17 22:21 UTC
Read the original article Hit count: 206

Filed under:

I have an activity that I want to programmatically stop after some elapsed time. I have a GL view running.

My understanding is that the GLSurfaceView.renderer is running in its own thread, so I created a handler instantiated from the activity. In the GLSurfaceView I post a message. The handler then attempts to stop the activity with the following: onStop(); finish();

The activity seems to close. However, if I try to restart the application, I get a blank screen, the phone is practically locked up and eventually I get a message that the activity in the application is not responding.

I'm also getting geting a wake lock, ie PowerManager.newWakeLock(...). When I try to release it, I get an exception.

Not sure if its the GL view of the wake lock which is causing me troubles. Any ideas appreciated.

© Stack Overflow or respective owner

Related posts about android