android - Alarm Manager firing instantly -


i know question has been asked many times , answered too, did check out lot of posts , tried of them how i'm still having trouble.

my code like:

cal = calendar.getinstance();     cal.settime(calendarutils.getdatefromstring(objscheduledo.schedulestarttime, calendarutils.time_format));     logutils.debug("time",cal.get(calendar.hour_of_day) + ":" + cal.get(calendar.minute));     am.set(alarmmanager.rtc_wakeup, cal.gettimeinmillis() , pi); 

i use rtc_wakeup fires instantly , if use elapsed_realtime_wakeup doesn't fire @ all.

and i'm sure start time never current time, future time.

time_format "hh:mm aa". , have further verified time correct, when tried cal.gettimeinmillis() through debug, received integer value instead of long, not sure whether android studio debug mode can give long value or not.

please help..

as per alarmmanager set method,

if stated trigger time in past, alarm triggered immediately.

verify date not past.


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -