Android Programming execute function at determined time

69 Views Asked by At

I am developing a project in Android and I would like to do the following: at a time determined by the user, like 15:40 for example, I would call a function to change the cellphone to silent mode. How can I set it so this function would be called only in this determined time?

1

There are 1 best solutions below

0
CommonsWare On BEST ANSWER

Use AlarmManager to trigger a WakefulBroadcastReceiver that can either do your work directly (if it is cheap) or delegate the work to an IntentService (if the work is expensive). The "function" would go in the receiver or the service.