title: Java android set Button on right side
body: <p>I have a linearlayout and inside I have a image button , how I can put image button on the right side ?</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="wrap_content"
      android:layout_height="wrap_content"
      android:descendantFocusability="blocksDescendants"
      android:divider="@drawable/divider_vert"
      android:minHeight="40dp"
      android:orientation="horizontal"
      android:showDividers="middle"&gt;
  &lt;ImageButton
      android:layout_width="wrap_content"
      android:background="@drawable/msg"
      android:id="@+id/msg"
      android:visibility="gone"
      android:layout_height="wrap_content"
  /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>