I can not return any number. Ex: If you use "minor 1500" and "greater 5000", it was to appear in this range if you did not enter while
, only it is not returning anything.
public int aleatoriar(int maior, int menor) {
int retorno = 0;
Calendar lCDateTime = Calendar.getInstance();
int datarecebe = (int) (lCDateTime.getTimeInMillis());
int recebe = datarecebe % 10000;
if (recebe > maior || recebe < menor) {
while(recebe >= maior && recebe <= menor) {
retorno = recebe;
}
} else {
retorno = recebe;
}
return retorno;
}