简体   繁体   中英

How to schedule timer for specific date and time in android?

eventPoller.schedule(new EventPoller(adapter),dateOfEvent , 100000);

  • I want to schedule remainder for particular date and time by using TimerTask. i am doing this without broadcast receiver as I just want to schedule it and show some notification as remainder to user.
  • so please suggest me, how can I pass the date and time both in this method so that Notification will come on that exact time and date.
  • is there any other way to remind events to user other than broadcast receiver?????

please suggest any solution asap.............

Use alarmManager.

Keep in mind that you need to set alarmManager every time user restarts phone. This means you need to implement BroadcastReciver and set it there.

If you need an example in can post it for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM