To schedule tasks that will be performed over and over again in the future, you can use the mechanism of Alarms android.
Depending on your use case the parameters and the alarm type can change, but it’s something like:
private AlarmManager alarmMgr;
private PendingIntent alarmIntent;
...
alarmMgr = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
// Intent para invocar uma classe no horário agendado
Intent intent = new Intent(context, AlarmReceiver.class);
alarmIntent = PendingIntent.getBroadcast(context, 0, intent, 0);
// Cria um calendário e muda sua hora para 14:00
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(System.currentTimeMillis());
calendar.set(Calendar.HOUR_OF_DAY, 14);
// setInexactRepeating() requer um dos intervalos definidos nas constantes do AlarmManager
// Neste exemplo o intervalo é AlarmManager.INTERVAL_DAY (um dia)
alarmMgr.setInexactRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), AlarmManager.INTERVAL_DAY, alarmIntent);
In this example an alarm was created for 14h of the current day, with an inaccurate daily repetition.
I strongly recommend taking a look at the Job Scheduler API or similar.
– Wakim