title: How to align textview in right corner?
body: <p>I have the following xml . </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/MainLayout"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:orientation="vertical" &gt;
  
      &lt;RelativeLayout
          android:id="@+id/smsItemContainerRelativeLayout"
          android:layout_width="match_parent"
          android:layout_height="wrap_content" &gt;
  
          &lt;TextView
              android:id="@+id/textView"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_alignParentTop="true"
              android:layout_centerInParent="true"
              android:layout_gravity="center_horizontal|top"
              android:text="SMS Inbox"
              android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
  
          &lt;TextView
              android:id="@+id/unread_count"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_marginLeft="-20dp"
              android:layout_toRightOf="@+id/textView"
              android:background="@drawable/notification_bg"
              android:gravity="center"
              android:text="88"
              android:textColor="@android:color/background_light"
              android:textSize="20sp"
              android:textStyle="bold"    
              android:visibility="visible" /&gt;
      &lt;/RelativeLayout&gt;
  
      &lt;ListView
          android:id="@+id/SMSList"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_margin="5dp" /&gt;
  
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>For this , I have the following layout : </p>
  
  <p><a href="https://i.stack.imgur.com/h2qhD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/h2qhD.png" alt="enter image description here"></a></p>
  
  <p>I want to shift textview of id unread_count to the right of parent . How can I do this ? </p>
  
  <p>If I set  android:layout_alignParentRight="true" then I have the following picture : </p>
  
  <p><a href="https://i.stack.imgur.com/VdeTq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VdeTq.png" alt="enter image description here"></a></p>
  
  <p>I simply want to get the following picture : </p>
  
  <p><a href="https://i.stack.imgur.com/txrCi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/txrCi.png" alt="enter image description here"></a></p>