Android's Camera Preview

This is a note to self post. Today I’ve been figuring out to have my own custom Camera Activity. A newbie mistake made the Activity to block the UI when initializing. Here’s the problem and the fix. I started camera.startPreview() at surfaceCreated(SurfaceHolder holder). When I moved to surfaceChanged(SurfaceHolder holder, int format, int width, int height), everything turns out as expected. Here’s the full class with an explanation below. To made matters worse, I called camera. [Read More]