0

I am working on one android application which allows user to set reminder for specific task or work. and i have created reminder in android using alarm manager. But my problem is when user move to some other time zone how can i change reminder time as per new time zone ?

2nd problem is if user have set reminder for two task at same time which one will get canceled by system ?

As android doesn't provide id for reminder. I have already checked link1, link2 questions on SO but it is not valid for me in my 2nd case.

Community
  • 1
  • 1
Wasim K. Memon
  • 5,979
  • 4
  • 40
  • 55

1 Answers1

1

You should not to do that becouse you set it up in abcolute unix time value right? It means that the same absolute time event will happens in the same moment in every time zone

P.S to cancele alarm you should use the same Intent as you use whent setup alarm. It just override previous alarm by new one. In my application i use only one alarm for all events, and i invalidate it value every time and set it up to earliest event time

  • hey can you explain it with some example. i got your point of setting alarm with timestamp. – Wasim K. Memon Feb 23 '16 at 09:28
  • alarmMgr.setInexactRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), AlarmManager.INTERVAL_DAY, alarmIntent); here you use time in millis it mean you use unix time. For example now it eqal 1456220086 no metter in what time zone i located it is the same to your time zone – Konstantin Volkov Feb 23 '16 at 09:32