Android: crash when accessing user class from thread
<p>When I try to call one of my custom classes from a Thread constructor I get an exception, I've no idea why...</p>

<p>My Main app boils down to:</p>

<pre><code>public class GameView extends SurfaceView implements OnTouchListener,    SurfaceHolder.Callback
{
   class GameThread extends Thread
   {
      private GfxData   m_GraphicsData;

      public GameThread(SurfaceHolder surfaceHolder, Context context, Handler handler)
      {
         Log.i("****", "GameThread::GameThread");
         m_GraphicsData.InitGfx();;
         Log.i("****", "GameThread::end");
      }
... (other required functions)
}
</code></pre>

<p>My GfxData class (the entire file)</p>

<pre><code>package mypackage.stuff;

public class GfxData 
{
   public GfxData()
   {
   }

   public void InitGfx()
   {
   }
} 
</code></pre>

<p>The class GameThread never reaches the end of the constructor; I've removed virtually everything from my GfxData class (which I'd intended to pass the context to so I could use it to manage my resources) but still it causes a crash; however if I remove the InitGfx() call everything is fine</p>

<p>I'm bamboozled! Help would be much appreciated.</p>
