title: Android MediaPlayer - error (1, -4) when playing a song
body: <p>I am trying to play an mp3 audio file from sd card, using the path and the filename of the audio file to get its Uri.</p>
  
  <p>I have a <code>Spinner</code> populated with the tracks names stored in sd card. 
  When an item is selected, the following code will be executed:</p>
  
  <pre><code>final Uri uri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
  OnItemSelectedListener listener = new OnItemSelectedListener(){
          @Override
          public void onItemSelected(AdapterView&lt;?&gt; parentView, View selectedItemView, int position, long id) {
              TextView tv = (TextView) selectedItemView;
  
              File file = new File(uri.getPath() + "/" + tv.getText().toString());
              Log.i(TAG, "-------------  PATH : " + file.getAbsolutePath());
              Uri uri = Uri.fromFile(file);
              MediaPlayer mP = new MediaPlayer();
              try {
                  mP.setDataSource(context, uri);
  
                  mP.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
                      @Override
                      public void onPrepared(MediaPlayer mp) {
                          // TODO Auto-generated method stub
                          mp.start();
  
                      }
                  });
  
              } catch (IllegalArgumentException e) {
                    e.printStackTrace();
              } catch (IllegalStateException e) {
                e.printStackTrace();
              } catch (IOException e) {
                e.printStackTrace();
              }
              try {
                  mP.prepare();
              } catch (IllegalStateException e) {
                e.printStackTrace();
              } catch (IOException e) {
               e.printStackTrace();
              }
  
          }
      };
  </code></pre>
  
  <p>I am getting the following errors:</p>
  
  <pre><code>08-21 16:16:37.099: I/MusicFileActivity(3940): -------------  PATH : /external/audio/media/antazirouka
  08-21 16:16:37.159: W/MediaPlayer(3940): info/warning (1, 26)
  08-21 16:16:37.159: E/MediaPlayer(3940): error (1, -4)
  08-21 16:16:37.159: W/System.err(3940): java.io.IOException: Prepare failed.: status=0x1
  08-21 16:16:37.169: W/System.err(3940):     at android.media.MediaPlayer.prepare(Native Method)
  08-21 16:16:37.169: W/System.err(3940):     at com.example.project.MusicFileActivity$1.onItemSelected(MusicFileActivity.java:84)
  08-21 16:16:37.169: W/System.err(3940):     at android.widget.AdapterView.fireOnSelected(AdapterView.java:871)
  08-21 16:16:37.169: W/System.err(3940):     at android.widget.AdapterView.access$200(AdapterView.java:42)
  08-21 16:16:37.169: W/System.err(3940):     at android.widget.AdapterView$SelectionNotifier.run(AdapterView.java:837)
  08-21 16:16:37.169: W/System.err(3940):     at android.os.Handler.handleCallback(Handler.java:587)
  08-21 16:16:37.169: W/System.err(3940):     at android.os.Handler.dispatchMessage(Handler.java:92)
  08-21 16:16:37.169: W/System.err(3940):     at android.os.Looper.loop(Looper.java:123)
  08-21 16:16:37.169: W/System.err(3940):     at android.app.ActivityThread.main(ActivityThread.java:3687)
  08-21 16:16:37.169: W/System.err(3940):     at java.lang.reflect.Method.invokeNative(Native Method)
  08-21 16:16:37.169: W/System.err(3940):     at java.lang.reflect.Method.invoke(Method.java:507)
  08-21 16:16:37.169: W/System.err(3940):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
  08-21 16:16:37.169: W/System.err(3940):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
  08-21 16:16:37.169: W/System.err(3940):     at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>Does anyone have any idea about it?
  Thanks in advance :)</p>