-1

I have an application that will create a persistent notification but I need to update this notification each day so is there a way to create a time listener or how to do it otherwise but I need this update to be performed even if the activity is not started, so even if the user did not open the application, I saw this page but it's just for an app that is still in its started state once it's in its pause state... it won't work anymore... any idea?

Community
  • 1
  • 1
User
  • 509
  • 2
  • 8
  • 23

2 Answers2

2

The Best way is to use AlarmManager see this link http://www.techrepublic.com/blog/android-app-builder/use-androids-alarmmanager-to-schedule-an-event/

Otherwise you will need to write service to keep track on time.

Good luck

Ajay
  • 552
  • 2
  • 4
  • 16
1

You could use an AlarmManager.

http://developer.android.com/reference/android/app/AlarmManager.html

Set up the alarm to trigger at the time you want to handle your event.

When you complete your event code, set up a new Alarm before you exit.

Note that alarms do not survive a reboot so you would need to set them up again at device boot (if required)

Kuffs
  • 35,581
  • 10
  • 79
  • 92