0

I have create an app, and I set a datetime value, when hits the datetime value, the app will trigger the function on Android phone background. Any idea?

Calvin89
  • 194
  • 1
  • 4
  • 15

3 Answers3

3

You should use the AlarmManager.

jcage
  • 651
  • 6
  • 14
1

Good answers from @jcage and @goodm. Just a hint: Don't forget to reset Alarm at device boot via a ACTION_BOOT_COMPLETED receiver in manifest. http://developer.android.com/reference/android/content/Intent.html#ACTION_BOOT_COMPLETED

Kevin Yuan
  • 1,008
  • 8
  • 20