1
に応じて、これまでのところ、私はそこにサムネイルの選択は、あるサムネイルをクリックしたら、それは以下のXMLに設定されているSurfaceView
とCamera Activity
を開きActivity
を持っています前に選択したサムネイルに応じてSurafceView
を変更できる方法が必要ですActivity
サムネイルをbuttons
として設定しました。私は各ボタンにSurfaceView
で使用するイメージ名と同じIDを与えていますので、ボタンID
を取って下のRelativeLayout
の背景を変更する方法があります。変更SurfaceViewイメージはサムネイル
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/overlay"
android:gravity="bottom"
android:orientation="vertical" >
<Button
android:id="@+id/takepicture"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_margin="10px"
android:layout_marginBottom="10dp"
android:background="@drawable/capture" />
</RelativeLayout>
のJava:
View viewControl = controlInflater.inflate(R.layout.control, null);
LayoutParams layoutParamsControl
= new LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.FILL_PARENT);
this.addContentView(viewControl, layoutParamsControl);
新しいアクティビティを開始したのですか、新しいレイアウトを設定するだけですか? –
Matt、カメラアクティビティのxmlレイアウトを追加するのを忘れました。あなたがボタンのIDで何をしようとしているかははっきりしていません。 –