title: set Width dynamically of textview
body: <p>In my project, i need to draw rows of textview dynamically according to the data received to show it. To align them properly, i have used Table Row n xml, and called it in java code. Now, in their LayoutParam i have given MATCH_PARENT, but it wraps the text according to the length of data received. Now, i want to fix width of the fields for a tabular view. I do all this process in postExecute method. In this method, i used setWidth function to set it according to the width of header row element.Here, Sno is a view, while size is array containing width of all elements of headerRow.</p>
  
  <pre><code> Sno.setTag(patient);
   Sno.setWidth(size[0]); 
  </code></pre>
  
  <p>But it didn't solve this problem, when i tried getWidth to see its width, it was showing its value 0.  Then i tried to set this width using LinearLayout.LinearParams</p>
  
  <pre><code>LinearLayout.LayoutParams params_sno = new LinearLayout.LayoutParams(size[0],
  LinearLayout.LayoutParams.MATCH_PARENT);
  Sno.setLayoutParams(params_sno);
  </code></pre>
  
  <p>but still no benefit, secondaly, if i remove MATCH_PARENT from width of LayoutParams, its width got increased from width of header row element.
  fields without data are invisible.</p>