我有一个很长的名单与搜索选项。我想要列表顶部和底部的按钮“搜索”。两个按钮都具有相同的功能。我认为只需在xml布局中复制并超过第一个按钮,但最后的按钮没有功能。如何在不在活动中添加一堆额外代码的情况下使其工作?是否有可能在同一个布局中拥有2个具有相同功能的按钮?
<ScrollView
android:layout_width= "fill_parent"
android:layout_height= "fill_parent" >
<LinearLayout
android:id="@+id/LinearLayout02"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<Button android:layout_width="fill_parent"
android:layout_height="wrap_content" android:id="@+id/save_search_options"
android:text="Search" android:textSize="25dip"></Button>
<!--search options in between-->
<Button android:layout_width="fill_parent"
android:layout_height="wrap_content" android:id="@+id/save_search_options"
android:text="Search" android:textSize="25dip"></Button>
</LinearLayout>
</ScrollView>