Solve Alarm Manager or Notification Firing Randomly

One time I develop an application that requires trigger a notification every specific time. Then I create Alarm Manager for trigger Android Notification, but i got my Alarm Manager firing random time after first notification. So my notification sometimes show at random time.

After search in stack overflow, i found one article that solve my problem. I add one line code (stopSelf();) in My Service Class after create service and notification (at the end of line of onStart method).

I hope can solve your firing randomly problem with Alarm Manager / Notification.

Happy coding guys :)

Comments (0)

Leave a comment

Your email address will not be published. Required fields are marked *