title: TextView resized to fit text
body: <p>I'm working on a custom view to resize the text inside a textview so it'll fit (i don't want to ellipsize).</p>
  
  <p>The trouble i'm having is that when changing the text size, the textview itself is not remeasured. I've been looking at the source and saw that the setTextSize() is calling the following:</p>
  
  <pre><code>nullLayouts();
  requestLayout();
  invalidate();
  </code></pre>
  
  <p>So it should've remeasured. This could be a bug because it works fine on 2.3 and not on 1.6,  1.5 and 2.1 emulators.  </p>
  
  <p>Here's piece of the code, note that textview is extended:</p>
  
  <pre><code>@Override
  protected void onSizeChanged(int w, int h, int oldw, int oldh) {
      if(w == 0 &amp;&amp; h == 0) {
          setTextSize(TypedValue.COMPLEX_UNIT_PX, defaultSize);
      }
  
      updateView();
  }
  
  private void updateView() {
      int viewWidth = getViewWidth();
      float textWidth = getTextWidth();
  
      float textSize = textSize();
      while(textWidth &gt; viewWidth &amp;&amp; textSize &gt;= MIN_TEXT_SIZE) {
  
          setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize-1);
  
          textSize = getTextSize();
  
          textWidth = getTextWidth();
      }
  }
  </code></pre>
  
  <p>Can anyone give me hint in the right direction to solve this issue?</p>