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

后端 未结 3 1967
灰色年华
灰色年华 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:27

    You could also use the flag PendingIntent.FLAG_UPDATE_CURRENT

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

    this should the work too

提交回复
热议问题