I wanted to know how to do to see if the current system time is within a previously defined radius
I currently have this code, but it always returns "Closed at the moment"
Calendar calendar = Calendar.getInstance();
final Date horaCheck = calendar.getTime();
try{
String horaAbre = getmHoraAbre();
Date hourAbre = new SimpleDateFormat("HH:mm").parse(horaAbre);
String horaFecha = getmHoraFecha();
Date hourFecha = new SimpleDateFormat("HH:mm").parse(horaFecha);
if (horaCheck.after(hourAbre) && horaCheck.before(hourFecha)) {
disponivelInfo.setText("Aberto no momento");
} else {
disponivelInfo.setText("Fechado no momento");
}
} catch (Exception e){
e.printStackTrace();
}