title: textview.getLineCount always 0 in android
body: <p>I'm trying to dynamically resize my textview but getlinecount() method always returns me 0 even after settext() and invalidate(). I'm using the following code:</p>
  <pre class="lang-java prettyprint-override"><code>if (convertView == null) {
      convertView = lInflater.inflate(R.layout.listview, null);
      holder = new ViewHolder();
      holder.text2 = (TextView)convertView.findViewById(R.id.TextView02);
      convertView.setTag(holder);
  } else {
      holder = (ViewHolder)convertView.getTag();
  }
  
  holder.text2.setText(arr2[position]);
  holder.text2.invalidate();
  
  int lineCnt = holder.text2.getLineCount();
  </code></pre>
  <p>holder is a static class as follows:</p>
  <pre class="lang-java prettyprint-override"><code>static class ViewHolder {
      TextView text2;
  }
  </code></pre>
  <p>holder contains non null text2 and the content set is also non null.</p>