OpenGLSurfaceView onPause freezes

In my app I've made it possible to start other embedded activities, however, very often, I get this in logcat:

W/ActivityManager( 1113): Activity pause timeout for ActivityRecord{42448180 u0 com.mydomain.TestApp/.Main t110}

and with log traces I can see that OpenGLView.onPause never returns, but seems to lock up the entire app (and the activity that was started never gets to onCreate).

There is an android bug, with workarounds noted here , but I don't know how related it is.

I just wanted to ping the community if someone has experienced this ?

Edit: Strange is that if I suspend/resume the application (implicitly by opening another application), OpenGLView.onPause does NOT lock...

Yes, I think I've seen something simlar (JuceDemo) - but never managed to qualify it

If I put the suspendApp() call first in JuceAppActivity.onPause(), it works better. Now OTOH, I routinely get a lock in JUCE OpenGLContext::Attachment::detach(), where the row:

comp.setCachedComponentImage (nullptr);

never returns.

Edit: Never mind. Completely barking up the wrong tree. Problem still present. Have no idea how to pursue this further... :(


I managed to "solve" it, well at least it hasn't occurred after the change. Instead of starting the other activity directly, I post a Runnable to an android.os.Handler and postpone the starting for 50 ms. So far this works... sigh...