Reputation: 39
I am developing a simple Android app that has a few Activities, say: A, B, C, and D. *Activity A* is a splash screen. Calls finish() when same data finishes loading. Activity B displays some information and a few buttons Activity C starts a webview with the content accordingly to the button pressed in B Activity D opens an openGL context.
From Activity A I go to Activity B., from B to C and from C to D.
Problem I face: some drawables and a progressBar display black rectangles after pressing the back button coming back from Activity D (activity that starts an openGL context).
Any ideas where I should look into?
Upvotes: 0
Views: 1048
Reputation: 70158
Adding android:hardwareAccelerated="false"
to the <application>
manifest is a workaround, however does not solve the problem. OpenGL state and context preservation as mentioned by Phil might play a role here.
Upvotes: 1
Reputation: 36289
Black boxes generally occur when the bitmap resource for an Image is no longer available (such as set to null
or recycled).
In an openGL view, this can occur when an activity goes to the background, often because of lost context. A good place to start would be looking at the GLSurfaceView documentation, in particular the method setPreserveEGLContextOnPause(...).
Upvotes: 2