I'm working on Android using Java and I have a question.
I want a button to be enabled only during a certain time period. Let's say I want the button to only work between 19:00 and 19:30 and after that it shows a error message, how would I achieve that?
I tried using something like this code, but it didn't work out:
public class LocalTimeDemo {
public static void main(String[] args) {
LocalTime time = LocalTime.now();
LocalTime time1 = LocalTime.parse("12:35:30");
System.out.println(time1.isBefore(time));
}
}
AlarmManager
and set alarm for specific time!.