How can i save numbers in List, where i could sort it from minimum to maximum.
I created new string where i insert all numbers. Than i get in in List and sort it. After that i check a number and i get colour od icon.
I tried this:
import java.util.Collections;
import java.util.ArrayList;
import java.io.*;
int colour1 = 1;
int colour2 = 3;
int colour3 = 2;
int colour4 = 3;
String rezerva =colour1, colour2, colour3, colour4;
List<String> myList = new ArrayList(rezerva);
Collections.sort(myList);
colour1 = myList.get(0);
if (colour1==1){
//change icon to red
}
else if (colour1==2){
//change icon to white
}
else {
//change icon to black
}
Use
Integerinstead ofStringfor your list