title: Adding a view to a LinearLayout at a specified position
body: <p>I have the following main.xml file with a LinearLayout</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:weightSum="1" android:id="@+id/llid"&gt;
      &lt;TextView android:text="Client profile"
      android:id="@+id/ProfileName"
      android:layout_width="fill_parent"
      android:textStyle="bold"
      android:layout_height="wrap_content"
      android:gravity="center_horizontal"&gt;
      &lt;/TextView&gt;    
      &lt;TextView android:text="Specs"
      android:id="@+id/Specs"
      android:layout_width="fill_parent"
      android:textStyle="bold"
      android:layout_height="wrap_content"
      android:gravity="center_horizontal"&gt;
      &lt;/TextView&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>I add an image to the LinearLayout via code at runtime like so</p>
  
  <pre><code>            ImageView image = new ImageView(this);
              image.setImageBitmap(bmp);
              LinearLayout ll = (LinearLayout) findViewById(R.id.llid);
              ll.addView(image);  
  </code></pre>
  
  <p>However, I want to add the ImageView between the 2 TextViews in my LinearLayout. I can't seem to find a way in the android docs to add a view before another view, or after. How can I do this? </p>
  
  <p><strong>NB</strong> I call </p>
  
  <pre><code>setContentView(R.layout.main);
  </code></pre>
  
  <p><strong>Before</strong> I add the ImageView to the LinearLayout.</p>