title: Setting TextView TextAppeareance Programmatically in android
body: <p>I am going to implement a <code>LinearLayout</code> in which the input fields are programmatically generated according to the number of fields of the database table.</p>
  
  <p>Unfortunately, when I am trying to set the attribute: <code>textApperance</code> as <code>textApperanceLarge</code> in the <code>TextView</code>, it doesn't work. Below is my code...</p>
  
  <pre><code>for (int i = 0; i &lt; selectedProducts; i++) {
  
              premLayout[i] = new LinearLayout(this);
              premLayout[i].setLayoutParams(new LinearLayout.LayoutParams(
                      LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
              premLayout[i].setOrientation(LinearLayout.HORIZONTAL);
              premLayout[i].setGravity(Gravity.TOP);
  
              premTextView[i] = new TextView(this);
              premTextView[i].setLayoutParams(new LinearLayout.LayoutParams(
                      LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT,
                      2.0f));
              premTextView[i].setTextAppearance(this, android.R.attr.textAppearanceLarge);
  
              premTextView[i].setText(premiumChannels.get(i));
              premTextView[i].setId(i + 600);
  
              int px = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, 20, getResources().getDisplayMetrics());
              premTextView[i].setWidth(px);
  
              premLayout[i].addView(premTextView[i]);
  </code></pre>