>how to get reference to GLSurfaceView's rendering thread? In your implementation of GLSurfaceView.Renderer.onSurfaceCreated() call Thread.currentThread() and put the result somewhere you can get at it.
On Thursday, August 2, 2012 4:18:04 PM UTC+1, Latimerius wrote: > > I'd like to call join() on it to make sure the thread has exited. > > (Broader context for those interested: I have a crash in my GL-based > app that happens like this: > > - device is put to sleep with my app in the foreground > - an incoming call wakes the device up > - I receive onResume() and I call onResume() on my GLSurfaceView > - I receive onPause() almost immediately after onResume() since the > phone app goes to the background due to the incoming call > - the time between onResume() and onPause() is rather short but enough > for GLSurfaceView to go through all of its setup up to and including > the initial onDrawFrame() call > - my onDrawFrame() goes into texture & geometry loading routine which > can take up to several seconds so it's still loading when onPause() is > called as mentioned previously > - like many people here I have a globally-accessible method of > retrieving a reference to my main Activity to be used as the current > Context. This is used while loading graphics data to read asset > files. > - this Context reference however gets nulled out in onPause() in an > attempt not to leak main Activity instances. As the main thread > running onPause() nulls it while the rendering thread is still needing > it to finish loading the program crashes. > > The idea is to call GLSurfaceView.onPause() and then wait until the > rendering thread actually exit. Then null the Context reference.) > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

