title: Android:How to play a WAV file using MediaPlayer
body: <p>When I try to play wav files using <code>MediaPlayer</code>, this causes a <code>NullPointerException</code> at <code>player.start()</code>.</p>
  
  <pre><code>File file = new File(Environment.getExternalStorageDirectory().getAbsolutePath().toString()+"/Notate/"+MainActivity.filepath);
  MainActivity.filepath,Toast.LENGTH_LONG).show();
  Uri uri=Uri.fromFile(file);
  MediaPlayer player=MediaPlayer.create(getActivity(),uri);
  try {
      player.prepare();
      player.start();
  }
  catch(IOException e){
      e.printStackTrace();
  }
  </code></pre>