Camera preview on LG Optimus Black
<p>I have a customer with an LG Optimus Black (android 2.2.2) that have the camera preview every time black. On other devices all is working fine. Is there some issue on this phone or someone have a solution? The code for my camera preview is the follow.</p>

<pre><code>    SurfaceHolder.Callback mySurfaceHolderCallback = new SurfaceHolder.Callback()
{
    @Override
    public void surfaceCreated(SurfaceHolder holder)
    {
        Log.i("GMG", "surfaceCreated");

        try
        {
            mCamera = Camera.open();
            holder.setFormat(PixelFormat.TRANSLUCENT);
            mCamera.setPreviewDisplay(holder);
        }
        catch (IOException e)
        {
            if (mCamera == null) return;
            mPreviewRunning= false;
            mCamera.release();
            mCamera = null;             
        }
    }

    @Override
    public void surfaceDestroyed(SurfaceHolder holder)
    {
        Log.i("GMG", "surfaceDestroyed");
        if (mCamera != null)
        {
            mCamera.stopPreview();
            mPreviewRunning= false;
            mCamera.release();
            mCamera = null;
        }
    }

    @Override
    public void surfaceChanged(SurfaceHolder holder, int format, int width, int height)
    {
        Log.i("GMG", "surfaceChanged");

        if (mCamera != null)
        {
            if(mPreviewRunning) mCamera.stopPreview();

            Camera.Parameters p = mCamera.getParameters();

            //Angolo visivo della fotocamera
            angoloVisualeX = p.getHorizontalViewAngle();
            angoloVisualeY = p.getVerticalViewAngle();

            //Formati della preview
            supportedPreviewSize = p.getSupportedPreviewSizes();            
            int preview_width = supportedPreviewSize.get(supportedPreviewSize.size()-1).width;
            int preview_height = supportedPreviewSize.get(supportedPreviewSize.size()-1).height;
            p.setPreviewSize(preview_width, preview_height);

            //Set camera orientation
            Display display = ((WindowManager)getSystemService(WINDOW_SERVICE)).getDefaultDisplay();
            if(display.getRotation() == Surface.ROTATION_0) mCamera.setDisplayOrientation(90);
            if(display.getRotation() == Surface.ROTATION_270) mCamera.setDisplayOrientation(180);

            mCamera.setParameters(p);
            mCamera.startPreview();
            mPreviewRunning = true;
        }
    }
};
</code></pre>

<p>Best regards.</p>
