I followed this example. However, when I transfer it to my phone (to use the camera), the preview is flipped 90 degrees to the left. In addition, it works fine.
My question is: how do I “unlock” the preview ?
Here are the contents of my layout file:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<android.view.SurfaceView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/preview"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</android.view.SurfaceView>
</LinearLayout>
In addition, when I try to rotate the phone myself, it remains in landscape mode.
Thanks in advance!
source
share