I have some problem when I try to develop my app with Htc devices.
When i open the camera, it put a white image at the bottom of my app. As you can see in the image, only i can use the camera with the half.
Anyone know how can I solve this problem? Any trick with HTC Devices?
Thank you.
Code:
OnCreate()
mHolder = getHolder();
mHolder.addCallback(this);
mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
and
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
if (mCamera != null) {
Camera.Parameters parameters = Reader.getBestCameraParameters( mCamera.getParameters() );
mCamera.setParameters(parameters);
try {
mCamera.setPreviewDisplay(holder);
} catch (IOException e) {
e.printStackTrace();
}
mPreviewSize = parameters.getPreviewSize();
//Start camera preview
mCamera.startPreview();
mCamera.setPreviewCallback(mPreviewFrames);
}
}
Solution: I have fixed the camera with one property. I put this, inside the activity of the camera in the manifest.
android:hardwareAccelerated="false"