title: LinearLayout put child at the right side
body: <p>I m trying to have a textview and a button in linear layout with horizontal orientation. The textview should appear at the starting and the button should appear at the end. I thought giving gravity right to the button would do the trick but the buttons doesn't move to the right side. I m thinking if I should probably use relative layout?</p>
  
  <p><img src="https://i.stack.imgur.com/dALuk.png" alt="enter image description here"></p>
  
  <pre><code>&lt;\LinearLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content" 
      android:orientation="horizontal"&gt;
  
      &lt;TextView
          android:id="@+id/productPriceTextView1"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="Rs 3579.0" 
          /&gt;
  
      &lt;Button
          android:id="@+id/buyNowButton1"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_gravity="right"
          android:text="Buy Now" /&gt;
  &lt;\/LinearLayout&gt;
  </code></pre>