title: Android media player bug
body: <p>I have the media player playing an mp3 when I load my application. But I had to move this application and now every time I load the application this gives a force close error. </p>
  
  <p>The media player is opened like this: </p>
  
  <pre><code> final MediaPlayer mp = MediaPlayer.create(Splash.this, R.raw.indra);
                     mp.start();
  </code></pre>
  
  <p>I know its the media player which causes the error as when I comment the lines above out the application works. </p>
  
  <p>Is there any other ways I can try to load the mp3?</p>
  
  <p>Thanks</p>
  
  <p>Edit:</p>
  
  <pre><code>MediaPlayer mp = new MediaPlayer();    
           AssetFileDescriptor descriptor = contex.getAssets().openFd("indra.mp3");
                  mp.setDataSource( descriptor.getFileDescriptor(), 
           descriptor.getStartOffset(), descriptor.getLength() );
                  descriptor.close();
           mp.prepare();
                      mp.start();
  </code></pre>
  
  <p>Edit: </p>
  
  <pre><code>try {
          MediaPlayer mp = new MediaPlayer();    
           AssetFileDescriptor descriptor;
  
              descriptor = contex.getAssets().openFd("indra.mp3");
                  mp.setDataSource( descriptor.getFileDescriptor(), 
           descriptor.getStartOffset(), descriptor.getLength() );
                  descriptor.close();
           mp.prepare();
                      mp.start();
              } catch (IOException e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
              }
  </code></pre>