title: Uncaught exception: no application instance (blackberry)
body: <p>Im trying to play an audio file using blackberry.
  This line - clickplayer.realize(); is throwing an exception - "Uncaught exception: no application instance". I'm not sure why this is being thrown ?</p>
  
  <pre><code>        UiApplication.getUiApplication().invokeLater(new Runnable() {
              public void run() {
                  AudioPlayback a = new AudioPlayback();
                  a.play();
              }
          });
  </code></pre>
  
  <p>This is the AudioPlayback class  -</p>
  
  <pre><code>public class AudioPlayback {
  
      public void play(){
  
          try {
          Player clickplayer = null;
          InputStream instream = getClass().getResourceAsStream("/jingle.wav");
          clickplayer = Manager.createPlayer(instream, "audio/x-wav");
          clickplayer.realize();
          clickplayer.setLoopCount(1);
  
          VolumeControl vc = (VolumeControl) clickplayer.getControl("VolumeControl"); 
          if (vc != null)
              vc.setLevel(100);
  
          clickplayer.prefetch();
          clickplayer.setMediaTime(0);
          clickplayer.start();
          }
          catch(Exception e){
              e.printStackTrace();
          }
  
  }
  </code></pre>