You can Use any Runnable but when app closed it will not working .
Foreground service is best choice but in android 9+, it will confuse the user
this is the link that show to you how use it:
Timer
BUT
I advice you to use an AlarmManager
that work like work manager but it response better, you can Use Countdown timer for it, link below will help You to use it:
AlarmManager
Edited:
sample for open activity with alarm manager
Intent intent = new Intent(this, YOUR_MAIN_ACTIVITY.class);
intent.setAction(Intent.ACTION_MAIN);
intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
PendingIntent pendingIntent = PendingIntent.getActivity(this, ID,
intent, 0);
final long DELAY_IN_MILLIS = DELAY_IN_MILLI_SECONDS+
System.currentTimeMillis();
AlarmManager alarmManager = (AlarmManager)
getSystemService(Activity.ALARM_SERVICE);
alarmManager.set(AlarmManager.RTC, DELAY_IN_MILLIS,pendingIntent);
and there is a full example for you:
Example