title: Add view to another one programmatically inside Fragment
body: <p>Something gone wrong on my code. I have an XML representing layout of my fragment (fragment_layout.xml):</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/root_layout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
     android:orientation="vertical" &gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>and another xml file representing a single view that shod go inside fragment layout (element.xml):</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent" &gt;
  
  &lt;TextView
      android:id="@+id/tv"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentLeft="true" /&gt;
  
  &lt;EditText
      android:id="@+id/et"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentRight="true"
      android:inputType="number"
      android:text="0" /&gt;
  
  &lt;/RelativeLayout&gt;   
  </code></pre>
  
  <p>and this is how i fill Fragment layout inside onCreateView method:</p>
  
  <pre><code>View view = inflater.inflate(R.layout.fragment_layout, container,
              false);
  
      some_elements = getActivity().getResources().getStringArray(
              R.array.some_array);
  
      LinearLayout root = (LinearLayout) view.findViewById(R.id.root_layout);
  
      for (int i = 0; i &lt; some_elements.length; i++) {
  
          View element = inflater.inflate(
                  R.layout.element, container, false);
  
          TextView tv= (TextView) element.findViewById(R.id.tv);
          prodotto.setText(prodotti[i]);
  
          EditText et= (EditText) element.findViewById(R.id.et);
  
          root.addView(element);
  
      }
  
      return view; 
  </code></pre>
  
  <p>Now happen that only first element of "some_elements" array is showed inside fragment (element contains 10 elements). why other elements is not showed? what's wrong?</p>