开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜