Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(shuffle == Constants.SHUFFLE_NORMAL || shuffle == Constants.SHUFFLE_AUTO){
- /* it is the same whether is next or previous */
- Cursor cursor = getAllSongsFromPlaylist(playlistId);
- int retries = 0;
- nextAudioId = audioId;
- while(nextAudioId == audioId && retries <= 20){
- cursor.moveToPosition((int) (Math.random() * (cursor.getCount()-1)));
- nextAudioId =
- ContentProviderUnifier.
- getAudioIdFromUnknownCursor(cursor);
- }
- if(retries == 20)
- nextAudioId = -1;
- cursor.close();
Add Comment
Please, Sign In to add comment