title: Programmatically add Views inside a (Linear)Layout (that is inside a ScrollView)
body: <p>I have an app that, after some clicking, shows activity with news contents. I want at a bottom of that to show comments, which are dynamically loaded in async task.</p>
  
  <p>One approach is to use ListView and custom ArrayAdapter, but, i would have to put ListView inside a ScrollView, and it is is a problem, even if i manually override ListView's height. It shows one list item, and one part of the following one.</p>
  
  <p>The other approach is to define LinearLayout as a holder for comments, than inflate another LinearLayouts defined in it's own xml file, populate it's contents, attach to holder's view. It works fine, from program's point of view, except it pushes comments below contents of the news. It's like, it creates another scrollable view of comments underneath contents od news (contents overlap it).</p>
  
  <p>Is there any other way of doing this that has nothing to do with lists, or how can i make the other approach to work.</p>
  
  <p>The relevant code snippet from xml layout that holds news contents is:</p>
  
  <pre><code>&lt;LinearLayout&gt; //global layout
      &lt;LinearLayout&gt;
          //views that hold title, date, content
      &lt;/LinearLayout&gt;      
  
          &lt;LinearLayout 
             android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:id="@+id/commentsHolder"
              android:orientation="vertical"&gt;
  
          &lt;View 
              android:layout_width="fill_parent"
              android:layout_height="2dp"
              android:background="#ed1b24"/&gt;
          &lt;TextView 
              android:layout_width="wrap_content"
              android:layout_height="fill_parent"
              android:text="KOMENTARI"
              android:layout_marginLeft="5dp"/&gt;
          &lt;View 
              android:layout_width="fill_parent"
              android:layout_height="1dp"
              android:background="#ed1b24"/&gt;
  
          &lt;LinearLayout
              android:layout_width="fill_parent"
              android:layout_height="0dip"
              android:orientation="vertical"
              android:id="@+id/comments_holder_view"
              android:layout_weight="1"&gt;
          &lt;/LinearLayout&gt;
  
  
      &lt;/LinearLayout&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>and code that corresponds to one comment is:</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@+id/comments_holder_item"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:orientation="vertical"
  android:padding="5dp"&gt;
  
  &lt;TextView 
      android:id="@+id/comment_content"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:background="@drawable/comments_back_details"
      android:text="Ovde ide tekst komentara, koji se, naravno, dinamicki dodaje."/&gt;
  
  &lt;LinearLayout 
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal"&gt;
  
      &lt;TextView 
          android:id="@+id/comment_author"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          style="@style/categoryStyle"
          /&gt;
  
      &lt;TextView 
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text=" | "
          style="@style/categoryStyle"
          /&gt;
  
      &lt;TextView 
          android:id="@+id/comment_pubdate"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          style="@style/categoryStyle"/&gt;
  
  &lt;/LinearLayout&gt;
  
  &lt;LinearLayout 
      android:layout_width="fill_parent"
      android:layout_height="1dp"
      android:orientation="horizontal"
      android:layout_margin="5dp"
      android:background="#d1d1d1"&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p>Thank you very much for any reply. This is quite important for me.</p>