title: adding a dynamic linearlayout to the current view android
body: <p>I am trying to add a linearlayout to a scrolview
  this is my code
  the code compiles, but it doesn't show me the new layout</p>
  
  <p>this is the original layout (that i want to add to it)</p>
  
  
  
  <pre><code>&lt;ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@+id/ScrollView01"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:scrollbars="vertical" 
  
  android:layout_margin="15dp"
  android:layout_marginTop="15dp"&gt;
  
  &lt;LinearLayout 
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical"
      android:paddingBottom="10dp"
      android:paddingLeft="10dp"
      android:paddingRight="10dp" 
       android:id="@+id/ViewHistoryImageLayout"&gt;
  
      &lt;ImageView
          android:id="@+id/HistoryImage"
          android:layout_width="match_parent"
          android:layout_height="0dip"
          android:layout_weight="0.76"
          android:gravity="center"
          android:padding="10dp"
          android:src="@drawable/upload" 
          android:contentDescription="@string/HistoryImage"/&gt;
  
      &lt;TextView
          android:id="@+id/TranslatedText"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_weight="0.12"
          android:paddingBottom="10dp"
          android:paddingLeft="10dp"
          android:paddingRight="10dp"
          android:text="@string/translateImageButton" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p>and this is the layout that i want to add several times:</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical"
  android:id="@+id/TranslationMenuLayout" &gt;
  
  &lt;TextView
      android:id="@+id/textView1"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:text="Medium Text"
      android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
  
  &lt;RatingBar
      android:id="@+id/ratingBar1"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:numStars="5" /&gt;
  
  &lt;TextView
      android:id="@+id/textView2"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:text="TextView" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>and the java code for adding the new layout is:</p>
  
  <pre><code>setContentView(R.layout.activity_view_history_image);
  ScrollView sv = new ScrollView(this);
  LayoutInflater inflater = (LayoutInflater) getSystemService( Context.LAYOUT_INFLATER_SERVICE );
  View ll = inflater.inflate(R.layout.translation_menu, null);
  sv.addView(ll);
  </code></pre>
  
  <p>the code compiles fine, and the app is running but nothing happens
  is there a problem with one of the .xml files?</p>
  
  <p>tnx</p>