title: Design suggestion: How to add programmatically add multiple (but indeterminate) 'Views' of the same class in an Android Activity
body: <p>I have this problem that I am not able to solve.</p>
  
  <p>An Activity in my Android app needs to build an object that has:</p>
  
  <ul>
  <li>a name</li>
  <li>a description</li>
  <li>zero or more items, described by name, price, and other info</li>
  </ul>
  
  <p>I have tried to implement the functionalities related to 'items' in a <code>Fragment</code>. Using a <code>Fragment</code> made sense to me because I would have been able to add some logic (various checks on the values) in the Fragment and have a lighter activity. I built my Activity with </p>
  
  <ul>
  <li>EditText for name</li>
  <li>EditText for description</li>
  <li>an ImageView '+' for adding Fragments</li>
  <li>a <code>LinearLayout</code> hosting the added fragments</li>
  </ul>
  
  <p>I cannot use <code>Fragments</code> because they are not kept during device rotation (I tried to restore the same views in the LinearLayout, with the same ids, but it does not work).</p>
  
  <p>How could I implement such a functionality? I could not find any example.</p>