title: How can I make a two images sit on opposite ends using a LinearLayout?
body: <p>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</p>
  
  <p>X----------------------------X</p>
  
  <p>Here is my XML</p>
  
  <pre><code>&lt;LinearLayout
              android:id="@+id/headerBarLinearLayout"
              android:layout_width="match_parent"
              android:layout_height="match_parent" &gt;
  
  
              &lt;ImageView
                  android:id="@+id/batteryImageView"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:src="@drawable/battery" android:layout_weight="0"/&gt;
  
              &lt;ImageView
                  android:id="@+id/exit_button"
                  style="@style/MotionMetrics.ExitButton"
                  android:src="@drawable/exit_button" android:layout_width="wrap_content"/&gt;
  
          &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Not sure why they aren't on opposite ends.</p>
  
  <p>Photo:</p>
  
  <p><img src="https://i.stack.imgur.com/oErH1.png" alt="enter image description here"></p>