I need to equalize spaces between four buttons. Is there any way this could be done? The problem is that first and last buttons needs to be near the edge, and the remaining space should be equally divided for remaining two buttons and three spaces.

layout/main.xml:
<LinearLayout
android:id="@+id/setupButtons"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<Button
android:id="@+id/setupButtonA1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/button_arrow_up"
android:enabled="true" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1">
<Button
android:id="@+id/setupButtonA2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/button_arrow_down"
android:layout_weight="0.5"
android:enabled="true" />
<Button
android:id="@+id/setupButtonB1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/button_arrow_up"
android:layout_weight="0.5"
android:enabled="false" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<Button
android:id="@+id/setupButtonB2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/button_arrow_down"
android:enabled="false" />
</LinearLayout>
</LinearLayout>
Thank you for all of your answers, the correct solution was:
<LinearLayout
android:id="@+id/setupButtons"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button
android:id="@+id/setupButtonA1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/button_arrow_up"
android:enabled="true" />
<View
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1" />
<Button
android:id="@+id/setupButtonA2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/button_arrow_down"
android:enabled="true" />
<View
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1" />
<Button
android:id="@+id/setupButtonB1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/button_arrow_up"
android:enabled="false" />
<View
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1" />
<Button
android:id="@+id/setupButtonB2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/button_arrow_down"
android:enabled="false" />
</LinearLayout>
you can use below code in which i have inserted blank views with weight 1 set in all the controls in linearlayout.