title: How to get playlist by name in android default music player?
body: <p>I want to play songs of a playlist name "myPlaylist" from Android music player in my Application i searched on internet that plays songs of selected playlist we can select playlist by ID i have 3 playlists in my GenyMotion i pass </p>
  
  <pre><code>  PlaySongsFromAPlaylist(0);
  </code></pre>
  
  <p>the 0 for first playlist
  my method is </p>
  
  <pre><code>    public void PlaySongsFromAPlaylist(int playListID){
  
      String[] ARG_STRING = {MediaStore.Audio.Media._ID,MediaStore.Audio.Media.DATA,MediaStore.Audio.Media.DISPLAY_NAME,MediaStore.Video.Media.SIZE,android.provider.MediaStore.MediaColumns.DATA};
  
      Uri membersUri= MediaStore.Audio.Playlists.Members.getContentUri("external", playListID);
      Cursor songsWithingAPlayList = this.managedQuery(membersUri, ARG_STRING, null, null, null);
      int theSongIDIwantToPlay = 0; // PLAYING FROM THE FIRST SONG
      if(songsWithingAPlayList != null)
      {
          songsWithingAPlayList.moveToPosition(theSongIDIwantToPlay);
          String DataStream = songsWithingAPlayList.getString(4);
          PlayMusic(DataStream);
          songsWithingAPlayList.close();
      }   
  }
  </code></pre>
  
  <p>but i am geting error</p>
  
  <p>java.lang.RuntimeException: Unable to start activity ComponentInfo{com.xample.playfromplaylist/com.xample.playfromplaylist.MainActivity}: android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0</p>
  
  <p>what is the problem can anyone help?</p>