title: Error preparing MediaPlayer
body: <p>My application consists of uploading a single media file from the users SDcard and uploading it to a listview. That part it self, works perfectly. Each uri is saved under an SQlite database which saves the files in the listview as well. </p>
  
  <p>However, Now I am trying to obtain its path and URI on itemClick so I am able to Start playing any audio file I want. </p>
  
  <p>The issue is that the URI is getting an error when I start to prepare it. I'm not sure if I formatted everything correctly, as I receive this error: </p>
  
  <pre><code>08-18 13:11:12.790 24401-25067/com.example.daniel.queue E/MediaPlayerNative: error (1, -2147483648)
  </code></pre>
  
  <p>I understand this error could mean a few things, but please, let me know if I am formatting my URI or path correctly.  I have my permissions so that is not the issue. I assume it may be a formatting issue but I am yet to find a solution.</p>
  
  <pre><code>private void ItemClick() {
  
      user_music_reccomadatons.setOnItemClickListener(new AdapterView.OnItemClickListener() {
          @Override
          public void onItemClick(AdapterView&lt;?&gt; adapterView, View view, int position, long l) {
              String pos = adapterView.getItemAtPosition(position).toString();
              Uri uriFile = Uri.fromFile(new File(pos));  //creates a Uri from a file
              String pathFile =   uriFile.getEncodedPath();  //gets coded path
              String path = Environment.getExternalStorageState() + pathFile;
              MediaPlayer mp = new MediaPlayer();
              try {
                  mp.setAudioStreamType(AudioManager.STREAM_MUSIC);
                  mp.setDataSource(getApplicationContext(), uriFile);
                  Log.d("DATA SOURCE"," GOT DATA SOURCE " + path);
  
              } catch (IOException e) {
                 Log.d("ERROR", "ERROR ON SETDATASOURCE");
              }
              try {
                  mp.prepare();
                  Log.d("Success!","");
              } catch (IOException e) {
                  Log.d("error", " ERROR PREPARING");
  
              }
  
  
              Log.d("data", "URI: "+ uriFile + " PATH "+ pathFile);
              Log.d("ENVI PATH", " path: "+ path);
  
  
  
  
  
                }
      });
  }
  </code></pre>