I have 2 images in a horizontal linear layout. I want one to sit on the left and another to sit on the very right. Like this
X—————————-X
Here is my XML
<LinearLayout
android:id="@+id/headerBarLinearLayout"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="@+id/batteryImageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/battery" android:layout_weight="0"/>
<ImageView
android:id="@+id/exit_button"
style="@style/MotionMetrics.ExitButton"
android:src="@drawable/exit_button" android:layout_width="wrap_content"/>
</LinearLayout>
Not sure why they aren’t on opposite ends.
Photo:

Use a relative layout for this. Like so: