Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AlarmManager.RTC_WAKEUP not working for some devices

I am using AlarmManager in my application to set alarm for a particular time. I have used AlarmManager.RTC_WAKEUP to set the alarm. When I am testing the same it's working on number of device like Lg optimus, Sony Xperia etc. But while testing the same app in Samsung Galaxy S3 I found that alarm is not working. I am still unable to understand why is this happening.

I am using following code to set alarm :-

            // create the object
            AlarmManager alarmManager = (AlarmManager) getActivity().getSystemService(Context.ALARM_SERVICE);

            //set the alarm for particular time

            alarmManager.set(AlarmManager.RTC_WAKEUP,cal1.getTimeInMillis(), PendingIntent.getBroadcast(getActivity(),reminderId,  intentAlarm, PendingIntent.FLAG_UPDATE_CURRENT));

Someone please help me to solve this strange problem. Any help would be appreciable. Thank you

like image 598
Salman Khan Avatar asked Mar 07 '14 09:03

Salman Khan


1 Answers

I'm not sure but it sounds the problem is with the way you set cal1's time and maybe different timezone.

like image 117
Dariush Malek Avatar answered Nov 30 '22 14:11

Dariush Malek