Taking picture result in a distorted image
<p>I'm using the the Android SDK sample to get an image from the camera. The code below is the only logic I added to the code. Essentially I'm taking the picture converting it to a bitmap and displaying it. Unfortunately this results on a real phone as a distorted image (on the emulator it is just fine)</p>

<p>Any help will be appreciated</p>

<p></p>

<pre><code>@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
    switch(keyCode){
        case KeyEvent.KEYCODE_CAMERA:
            mCamera.takePicture(null, null,new PictureCallback(){

                @Override
                public void onPictureTaken(byte[] data, Camera camera) {
                    showPicture(data);
                }

            });
            break;
    }
    return super.onKeyDown(keyCode, event);
}

void showPicture(byte[] data) {

    if (data != null) {
        Bitmap picture = BitmapFactory
                .decodeByteArray(data, 0, data.length);
        ImageView view = new ImageView(this);
        view.setImageBitmap(picture);
        this.setContentView(view);

    }

}
</code></pre>

<p></p>
