I am implementing an app that takes images from the camera preview and
displays them on the screen. When the activity is paused and resumed
the surface will no longer display anything that is written to it. The
SurfaceView object appears to be fine but simply won't display.
I have three basic objects:
public class PanoramaCamera extends Activity {} -- the main activity.
public class Preview extends SurfaceView {} -- implements the surface
which gets the camera preview data.
public public class GLLayer extends SurfaceView {} -- implements the
surface which draws the camera images to the screen. This uses OpenGL
to draw the images.
There are multiple Preview objects but only a single GLLayer.
In PanoramaCamera's onPause() method I release the camera for each of
the existing Preview objects, free those objects and even free the
GLLayer object (though I have tried various combinations of the above)
and in onResume() I recreate the objects exactly the same way they
were created on launch. On recreating everything the surface no longer
displays. I can share some code if it helps.
Do I need to do anything special to pause and resume a SurfaceView?
-Dale
--
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