1
到目前为止,我有一个Activity
那里有一个选择的缩略图,一旦缩略图点击它打开了Camera Activity
与在下面的XML被设置SurfaceView
:变化SurfaceView图片根据缩略图
我需要一种方法能够更改SurafceView
,具体取决于在先前的Activity
中选择了哪个缩略图我的缩略图设置为buttons
。我给每个按钮相同的ID,因为它应该在SurfaceView
使用图像名称,以便有没有办法把按钮ID
并更改以下RelativeLayout
背景。
<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);
你开始一个新的活动或只是设置新的布局? – 2012-02-16 12:54:19
Matt,你忘记了添加Camera Activity xml布局。除此之外,你不太清楚你想用按钮ID做什么。 – 2012-02-22 08:07:15