<LinearLayout xmlns:android=“http://schemas.android.com/apk/res/android”
android:orientation=“horizontal”
android:layout_width=“match_parent”
android:layout_height=“match_parent”
<FrameLayout
android:id="@+id/camera_preview"
android:layout_width=“match_parent”
android:layout_height=“match_parent”
android:layout_weight=“1”
/>
<Button
android:id="@+id/button_capture"
android:text=“照相”
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:layout_gravity=“center”
/>
想要对摄像头进行一系列操作,包括获取图片,就要先获取Camera类,。
public static Camera getCam