Search code examples
androidnotificationsalarmmanagerreminders

Android Multiple Alarm With Different Notification


My app like reminder, user choose a film and user will set alarm -every day or once a week- on my app. If user want set multiple alarm for different films. I want to send notification every alarm with different content. I tried AlarmService but I can set just one alarm. I search it on Google but I can't find anything for my work. How can I do that? Please say your idea.


Solution

  • Use AlarmManager to send a broadcast using a pending intent with the information of the movie in the extras and then use a BroadcastReceiver to build and display the notification.

    This looks like a good example: https://gist.github.com/BrandonSmith/6679223

    check: https://developer.android.com/reference/android/app/AlarmManager.html

    https://developer.android.com/guide/components/broadcasts