Last active
August 10, 2020 05:53
-
-
Save bengongon97/984b2c5f44daf6de88ad912ea0423430 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void onItemClick(List<HwAudioPlayItem> myPlayList, int position) { | |
if (mHwAudioPlayerManager != null && mHwAudioQueueManager != null && mHwAudioQueueManager.getAllPlaylist() != null) { | |
/* | |
* 1. Obtains a playlist using the mHwAudioQueueManager.getAllPlaylist() method. | |
* 2. Compare myPlayList with mHwAudioQueueManager. | |
*/ | |
if (mHwAudioQueueManager.getAllPlaylist() == myPlayList) { | |
//If the two playlists are the same, the user-specified song is played. | |
mHwAudioPlayerManager.play(position); | |
} else { | |
//If the two playlists are different, the mHwAudioPlayerManager playlist is updated. | |
//The music specified by the user is played. | |
mHwAudioPlayerManager.playList(playList, position, 0); | |
mHwAudioPlayerManager.setPlayMode(0); | |
mHwAudioQueueManager.setPlaylist(playList); | |
Log.w("Playlist", mHwAudioQueueManager.getAllPlaylist() + ""); | |
} | |
} | |
} | |
/* | |
@Override | |
public void onItemClick(int position) { | |
if(mHwAudioPlayerManager != null){ | |
mHwAudioPlayerManager.play(position); | |
} | |
}*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment