Joel Fischer
Joel Fischer

Reputation: 6597

Android How to be Notified at a Specific Time

When my Android app reaches a specific time (say, 1400 hours) the app should do a specific thing, such as enter a Night Mode. At no other time would the app want to do this, and it seems like a waste to poll for this time. Is there a way to have Android notify my app when this time is reached?

Upvotes: 0

Views: 52

Answers (2)

Anuranjit Maindola
Anuranjit Maindola

Reputation: 1507

Create a alaram manager and give it a pending intent, this intent will have the code which you want execute at that moment

Upvotes: 1

Lesleh
Lesleh

Reputation: 1675

Create an alarm with AlarmManager.

Upvotes: 1

Related Questions