title: java.io.IOException: Prepare failed.: status=0x1 in Android
body: <p>I tried to play a file in <code>ListView</code> with <code>mediaPlayer</code> class.</p>
  
  <p>Like this:</p>
  
  <pre><code>public void initializeViews() {
      Intent intent = getIntent();
      String fName = intent.getStringExtra("fileName");
      fileName = (TextView) findViewById(R.id.fileName);
      duration = (TextView) findViewById(R.id.songDuration);
      seekbar = (SeekBar) findViewById(R.id.seekBar);
      playBtn = (ImageButton) findViewById(R.id.media_play);
      try {
          mediaPlayer = new android.media.MediaPlayer();
          mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
          mediaPlayer.setDataSource(fName);
          mediaPlayer.prepare();
      }
      catch (IOException e) {
          e.printStackTrace();
      }
      fileName.setText(fName.substring(fName.lastIndexOf("/") + 1));
      finalTime = mediaPlayer.getDuration();
      seekbar.setOnSeekBarChangeListener(mOnSeek);
      seekbar.setMax((int) finalTime);
      seekbar.setClickable(true);
      mediaPlayer.start();
      timeElapsed = mediaPlayer.getCurrentPosition();
      seekbar.setProgress((int) timeElapsed);
      durationHandler.postDelayed(updateSeekBarTime, 200);
  }
  </code></pre>
  
  <p>I search on the internet, and the most question is check the path to file, but the <code>fName</code> got the full path to a file. But I don't know it shows exception:</p>
  
  <p><code>java.io.IOException: Prepare failed.: status=0x1</code></p>
  
  <p>All log when application occurs exception:</p>
  
  <pre><code>E/MediaPlayer: error (1, -2147483648)
  W/System.err: java.io.IOException: Prepare failed.: status=0x1
  W/System.err:     at android.media.MediaPlayer.prepare(Native Method)
  W/System.err:     at kr.co.composer.callrecord.media.AudioPlayer.initializeViews(AudioPlayer.java:56)
  W/System.err:     at kr.co.composer.callrecord.media.AudioPlayer.onCreate(AudioPlayer.java:42)
  W/System.err:     at android.app.Activity.performCreate(Activity.java:5231)
  W/System.err:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
  W/System.err:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
  W/System.err:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
  W/System.err:     at android.app.ActivityThread.access$800(ActivityThread.java:135)
  W/System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
  W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:102)
  W/System.err:     at android.os.Looper.loop(Looper.java:136)
  W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:5001)
  W/System.err:     at java.lang.reflect.Method.invokeNative(Native Method)
  W/System.err:     at java.lang.reflect.Method.invoke(Method.java:515)
  W/System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
  W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
  W/System.err:     at dalvik.system.NativeStart.main(Native Method)
  E/MediaPlayer: Attempt to call getDuration without a valid mediaplayer
  E/MediaPlayer: error (-38, 0)
  E/MediaPlayer: start called in state 0
  E/MediaPlayer: error (-38, 0)
  E/MediaPlayer: Error (-38,0)
  E/MediaPlayer: Error (-38,0)
  W/EGL_genymotion: eglSurfaceAttrib not implemented
  stop called in state 0
  error (-38, 0)
  stop called in state 0
  error (-38, 0)
  Error (-38,0)
  Error (-38,0)
  stop called in state 0
  error (-38, 0)
  Error (-38,0)
  pause called in state 0
  error (-38, 0)
  </code></pre>