title: Android - DrawText on Canvas or TextView.draw
body: <p>In my Android (<code>API 10</code>) game I've used a <code>MVC pattern</code>, a <code>SurfaceView</code> with a canvas and a <code>ListView</code> for input's choice.</p>
  
  <pre><code>&lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:orientation="horizontal" &gt;
  
  &lt;com.gorgo.pirates.MainGamePanel
      android:id="@+id/surface"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_gravity="center" &gt;
  &lt;/com.gorgo.pirates.MainGamePanel&gt;
  
  &lt;ListView
      android:id="@+id/mylist"
      android:layout_width="match_parent"
      android:layout_height="110dp"
      android:layout_gravity="center_horizontal|bottom"
      android:background="@android:color/transparent"
      android:cacheColorHint="@android:color/transparent"
      android:divider="#00000000"
      android:drawSelectorOnTop="true" &gt;
  &lt;/ListView&gt;
  </code></pre>
  
  <p></p>
  
  <p>So now I need to show on screen a lot of String (speeches between characters or narrator text): they stay on screen 4 seconds and they hide themself later, I change the text and reuse them and so on.</p>
  
  <p>I've wrote <a href="http://pastebin.com/bYmzpxCg" rel="nofollow">this Class</a> that worked but it initialized a new <code>TextView</code> every <code>draw()</code> call O_O </p>
  
  <p>But I've discovered that I can't create 3 or 4 <code>TextView</code> and <code>setText</code> whenever I want because of my external Thread that can't modify a <code>View</code>. I've tried with an handler with no success.</p>
  
  <p>So I'm thinking about <code>canvas.drawText()</code> but I don't know if it's the right way.
  I need also that my String automatically fits in my widht (Pastebin's class does it) and uses a custom Font.</p>
  
  <p>Hints? :(</p>