I have an arraylist of songs uri from spotify using android sdk. But only one song is playing I want to detect when one song is complete so that I can initiate another song below is the code I am using.
Config playerConfig = new Config(this,sharedPreferences.getString(KEY,""),CLIENT_ID);
Spotify.getPlayer(playerConfig, this, new SpotifyPlayer.InitializationObserver() {
@Override
public void onInitialized(SpotifyPlayer spotifyPlayer) {
mPlayer = spotifyPlayer;
// Toast.makeText(MainActivity.this,mPlayer.getMetadata().toString(),Toast.LENGTH_LONG).show();
// System.out.println(response.getAccessToken());
mPlayer.addNotificationCallback(PlaySong.this);
mPlayer.play(track.get(curr).getUriFull(), 0, 0);
mPlayer.queue(track.get(1).getUriFull());
// mPlayer.addPlayerNotificationCallback(MainActivity.this);
}
@Override
public void onError(Throwable throwable) {
}
});
Any help would be appreciated.