title: layout_alignParentRight not working for relative layout inside linear layout
body: <p>I have two relative layout inside linear layout. I want the first relative layout left align and the second relative layout right align. I set the following line in the second relative layout but it is not working.</p>
  
  <pre><code>android:layout_alignParentRight="true"
  </code></pre>
  
  <p>and my full xml file goes here.</p>
  
  <pre><code>&lt;ScrollView
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:fillViewport="true"
      xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  
      &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
          android:paddingLeft="@dimen/activity_horizontal_margin"
          android:paddingRight="@dimen/activity_horizontal_margin"
          android:paddingTop="@dimen/activity_vertical_margin"
          android:paddingBottom="@dimen/activity_vertical_margin"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:weightSum="100"&gt;
  
      &lt;RelativeLayout
          android:id="@+id/left"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:layout_weight="45"
          android:background="@drawable/listview"&gt;
          &lt;ImageView
              android:id="@+id/leftPanelImage"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_margin="5dp"
              android:src="@drawable/sports"/&gt;
          &lt;TextView
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:text="left panel"
              android:layout_marginTop="5dp"
              android:layout_below="@id/leftPanelImage"/&gt;
      &lt;/RelativeLayout&gt;
  
      &lt;RelativeLayout
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:layout_weight="45"
          android:background="@drawable/listview"
          android:layout_alignParentRight="true"
          &gt;
          &lt;ImageView
              android:id="@+id/rightPanelImage"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_margin="5dp"
              android:src="@drawable/sports"/&gt;
          &lt;TextView
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:text="right panel"
              android:layout_marginTop="5dp"
              android:layout_below="@id/rightPanelImage"/&gt;
      &lt;/RelativeLayout&gt;
  
  
  
  &lt;/LinearLayout&gt;
  &lt;/ScrollView&gt;
  </code></pre>
  
  <p>My current code gives an output like this. Second layout start after first layout. I want it to start from the right from parent.</p>
  
  <p><img src="https://i.stack.imgur.com/4fUsD.png" alt="enter image description here"></p>
  
  <p>So my question is how can I set the second relative layout right align. </p>
  
  <p>Thank you.</p>