code: public void removeTrack(int playlistIndex) {
          checkState();
          SoundCloudTrack currentTrack = mPlayerPlaylist.getCurrentTrack();
          SoundCloudTrack removedTrack = mPlayerPlaylist.remove(playlistIndex);
  
          if (removedTrack == null) {
              // nothing removed
              return;
          }
  
          if (mPlayerPlaylist.isEmpty()) {
              // playlist empty after deletion, stop player;
              PlaybackService.stop(getContext(), mClientKey);
          } else if (currentTrack != null && currentTrack.equals(removedTrack) && mState == STATE_PLAYING) {
              // play next track if removed one was the current and playing
              play(mPlayerPlaylist.getCurrentTrackIndex());
          }
  
          for (CheerleaderPlaylistListener listener : mCheerleaderPlaylistListeners) {
              listener.onTrackRemoved(removedTrack, mPlayerPlaylist.isEmpty());
          }
      }
docs: Remove a track from the SoundCloud player playlist.
  <p/>
  If the track is currently played, it will be stopped before being removed.
  
  @param playlistIndex index of the track to be removed.