Guest User

Untitled

a guest
Jun 19th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. if(shuffle == Constants.SHUFFLE_NORMAL || shuffle == Constants.SHUFFLE_AUTO){
  2. /* it is the same whether is next or previous */
  3. Cursor cursor = getAllSongsFromPlaylist(playlistId);
  4. int retries = 0;
  5. nextAudioId = audioId;
  6. while(nextAudioId == audioId && retries <= 20){
  7. cursor.moveToPosition((int) (Math.random() * (cursor.getCount()-1)));
  8. nextAudioId =
  9. ContentProviderUnifier.
  10. getAudioIdFromUnknownCursor(cursor);
  11. }
  12. if(retries == 20)
  13. nextAudioId = -1;
  14. cursor.close();
Add Comment
Please, Sign In to add comment