Can I create an array of song and use the shuffle() method for it? [duplicate]
up vote
0
down vote
favorite
This question already has an answer here:
Random shuffling of an array
25 answers
Hi can I have and array of int music = {R.raw.song1, R.raw.song2}
and use the music.shuffle() ? so that I will put this method in the next button for it to shuffles to a random songs ?
marked as duplicate by ישו אוהב אותך, Community♦ Nov 21 at 22:16
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
up vote
0
down vote
favorite
This question already has an answer here:
Random shuffling of an array
25 answers
Hi can I have and array of int music = {R.raw.song1, R.raw.song2}
and use the music.shuffle() ? so that I will put this method in the next button for it to shuffles to a random songs ?
marked as duplicate by ישו אוהב אותך, Community♦ Nov 21 at 22:16
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
This question already has an answer here:
Random shuffling of an array
25 answers
Hi can I have and array of int music = {R.raw.song1, R.raw.song2}
and use the music.shuffle() ? so that I will put this method in the next button for it to shuffles to a random songs ?
This question already has an answer here:
Random shuffling of an array
25 answers
Hi can I have and array of int music = {R.raw.song1, R.raw.song2}
and use the music.shuffle() ? so that I will put this method in the next button for it to shuffles to a random songs ?
This question already has an answer here:
Random shuffling of an array
25 answers
asked Nov 14 at 22:55
BeAmazedVariable
63
63
marked as duplicate by ישו אוהב אותך, Community♦ Nov 21 at 22:16
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by ישו אוהב אותך, Community♦ Nov 21 at 22:16
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
hope this helps
private int getRandomSong(int music) {
int max = music.length - 1;
int min = 0;
int random = (new Random()).nextInt((max - min) + 1) + min;
return music[random];
}
happy coding :)
next time try to give a bit more information about the question else you will get down votes unnecessarily :)
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
hope this helps
private int getRandomSong(int music) {
int max = music.length - 1;
int min = 0;
int random = (new Random()).nextInt((max - min) + 1) + min;
return music[random];
}
happy coding :)
next time try to give a bit more information about the question else you will get down votes unnecessarily :)
add a comment |
up vote
0
down vote
accepted
hope this helps
private int getRandomSong(int music) {
int max = music.length - 1;
int min = 0;
int random = (new Random()).nextInt((max - min) + 1) + min;
return music[random];
}
happy coding :)
next time try to give a bit more information about the question else you will get down votes unnecessarily :)
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
hope this helps
private int getRandomSong(int music) {
int max = music.length - 1;
int min = 0;
int random = (new Random()).nextInt((max - min) + 1) + min;
return music[random];
}
happy coding :)
next time try to give a bit more information about the question else you will get down votes unnecessarily :)
hope this helps
private int getRandomSong(int music) {
int max = music.length - 1;
int min = 0;
int random = (new Random()).nextInt((max - min) + 1) + min;
return music[random];
}
happy coding :)
next time try to give a bit more information about the question else you will get down votes unnecessarily :)
answered Nov 14 at 23:02
Har Kal
590314
590314
add a comment |
add a comment |