Android camera out of memory exception
I have a strange problem on my htc hero. When launching camera, i get out of memory exception. After that, if i launch any other application that uses camera, they also crash(when trying to use camera function). I call camera.re开发者_JAVA技巧lease and camera.stoppreview in surfacedestroyed function, but that doesnt help.
What is the right way to release all resources? Could somebody please show his working surfacechanged, surfacecreated and surfacedestroyed functions? I have empty onPreviewFrame function, should i put something there?
How about this search for "surfacechanged" in Google Code Search? The first result is from the Android source code.
Look at the source code to Barcode Scanner. Look at what it does with onPause()
and onResume()
, via CameraManager
.
精彩评论