title: placing an element to the right in a linear layout in android
body: <p>I want to place an image to the right of the view. For that I am tyring to use something like</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent" &gt;
  
  ...some other elements
  
  &lt;LinearLayout
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      &gt;
  
      &lt;ImageView
          android:id="@+id/imageIcon"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"            
          android:layout_gravity="right"
          android:src="@drawable/image_icon" &gt;
      &lt;/ImageView&gt;
  &lt;/LinearLayout&gt;
  
  ...
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>The above seems to put the image somewhere in the center. How do I ensure that the image is right aligned regardless of whether we are in portrait or landscape mode?</p>
  
  <p>Thanx!</p>