title: How to make a Button align to the right in a layout?
body: <p>I have a custom ListItem row that has a TextView on the top and a TextView on the bottom. I would like to create a Button that is right aligned, and in centered vertically. How can I do this in 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:layout_width="fill_parent"
      android:layout_height="?android:attr/listPreferredItemHeight"
      android:padding="6dip"&gt;
  
      &lt;LinearLayout
          android:orientation="vertical"
          android:layout_width="0dip"
          android:layout_weight="1"
          android:layout_height="fill_parent"&gt;
          &lt;TextView
              android:id="@+id/toptext"
              android:layout_width="fill_parent"
              android:layout_height="0dip"
              android:layout_weight="1"
              android:gravity="center_vertical"
         android:textSize="18sp" android:textColor="#FFFFFF"/&gt;
  
          &lt;TextView
              android:layout_width="fill_parent"
              android:layout_height="0dip"
              android:layout_weight="1" 
              android:id="@+id/bottomtext"
              android:singleLine="true"
              android:ellipsize="marquee"
          android:textSize="15sp" android:textColor="#FFFFFF"/&gt;
  
  &lt;/LinearLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>