Android OnApplicationPause() Render Texture issue

Hello!

I’m not sure if this is the right place to ask questions like this, but I figured it probably can’t hurt.

I’m working on debugging an issue with some android devices (i.e. Samsung Galaxy Nexus, SCH-15I5) causing render textures to have different textures after resuming the application from sleep.

Specifically, if I call RenderTexture.Release() on all of my rendertextures, I get the same result.

I’ve been lead to learn that android devices lose their openGL context after a pause/resume, and believe this is the cause of the issue.

I’ve been able to “fix” the issue by reloading the textures after resume, but only if I wait an arbitrary time after OnApplicationPause is fired. i.e.

IEnumerator OnApplicationPause(bool pause) {
yield return new WaitForSeconds(2.0f);
…loop through all rendertextures, release and reload
}

works, but yield return new WaitForEndOfFrame();

only sometimes works, not always.

Is there any way to know that Android has recreated it’s render context? How would I go about gating the reload? I don’t want to have the arbitrary wait. It feels odd.

}

Think I may be seeing the same sort of issue on WP8, too - rendertextures losing their contents on suspend, but I’m currently having no success re-creating them in OnApplicationPause :frowning:

@SurrealArboreal : Have a look here : http://forum.unity3d.com/threads/246843-WP8-Suspend-Resume-and-lost-rendertextures?p=1638149&posted=1#post1638149