title: Context inside a Runnable
body: <p>I try to play a sound from R.raw. inside a Thread/Runnable
  But I can't get this to work.</p>
  
  <pre>
  new Runnable(){ 
    public void run() {  
  
      //this is giving me a NullPointerException, because getBaseContext is null  
      MediaPlayer mp = MediaPlayer.create( getBaseContext(), R.raw.soundfile);  
  
      while (true) {  
        if (something)  
            play something  
      }  
    }
  
  </pre>
  
  <p>How can I get the real Context inside the run method? It is null no matter what I try. Or is there a better way to do this?</p>