I have two buttons defined in XML
<Button
android:layout_alignParentBottom="true"
android:id="@+id/takepic_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/Take_Pic"
android:layout_gravity="left"
android:layout_alignParentLeft="true"
/>
<Button
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:id="@+id/cancel_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/Cancel"
android:layout_gravity="right"
/>
My question is how can I tell android that set the width of second button equal to whatever is the width of first button.
Update: I am looking for XML solution
Use the android:layout_weight properties set to the same value for both of your button.