how ca i shuffle this array randomly ? basically i have 4 buttons and i want to change the text of buttons randomly. for example: button have black,red,yellow,green receptively and i need to change these texts randomly when i click any of button.
this is my code
final int[] name={ R.string.text1,R.string.text2,R.string.text3,R.string.text4};
List<Integer> shuffle = new ArrayList<Integer>(Arrays.asList(name));
for(int i = 0; i <shuffle.Count(); i++)
b[i].Text = shuffle[i];