title: Dynamically adding a textview to a linear layout
body: <p>I wanted to dynamically add textview to a linear layout.</p>
  
  <p>I have used the following code:</p>
  
  <pre><code>    LinearLayout ll = (LinearLayout)findViewById(R.id.viewlayout);
      LinearLayout.LayoutParams lp = new    LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
      TextView tv = new TextView(viewrecords.this);
      tv.setId(1);
      tv.setTextSize(15);
      tv.setText("test adding");
      tv.setLayoutParams(lp);
      ll.addView(tv);
  </code></pre>
  
  <p>Iam not getting the textview added.Can any one help me out to solve the issue.</p>