title: Using LayoutInflater to create dynamic view
body: <p>I have created a xml file I wish to repeat a number of times and populate within the main view.
  I have read that LayoutInflater is the way to go but I am having issues getting it to work</p>
  
  <p>first question. the xml item I created has a number of textview within it. Can this be done or can the xml only contain one textview?</p>
  
  <pre><code>ScrollView mainlayout = (ScrollView) findViewById(R.id.ScrollView1);    
  LayoutInflater  inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
              View view = (View) inflater.inflate(R.layout.sightmarks_item, null);
              TextView textview1 = (TextView) inflater.inflate(R.id.textView1, null);
              EditText editview1 = (EditText) inflater.inflate(R.id.editview1, null);
              EditText editview2= (EditText) inflater.inflate(R.id.editview2, null);
  </code></pre>
  
  <p>I am then running round a for loop on an array and setting the text for each the values above and then adding the view to the mainlayout view</p>
  
  <p>Currently it is erroring on the inflated view.
  am I doing this correctly?</p>
  
  <p>Thanks </p>