Multiple calls to AlarmManager.setRepeating deliver the same Intent/PendingIntent extra values, but I supplied different ones

后端 未结 3 1989
灰色年华
灰色年华 2020-12-08 16:32

Solved while writing this question, but posting in case it helps anyone:

I\'m setting multiple alarms like this, with different values of id:

         


        
3条回答
  •  再見小時候
    2020-12-08 17:23

    The solution for your problem is use Intent.FLAG_ACTIVITY_NEW_TASK

      p = PendingIntent.getBroadcast(context, 0, i, Intent.FLAG_ACTIVITY_NEW_TASK);
    

提交回复
热议问题