FLAG_CANCEL_CURRENT or FLAG_UPDATE_CURRENT

前端 未结 2 1609
春和景丽
春和景丽 2020-12-15 22:42

My app sets a repeating alarm on user interaction, it might change the interval time set for the broadcast with Alarm Manager.
There is not much in the way of extras.

2条回答
  •  北荒
    北荒 (楼主)
    2020-12-15 23:18

    If you are not using extras, you don't have to specify any of those flags. They only change how the systems handles extras with a PendingIntent: replace the ones in the current matching (cached by the system PendingIntent) or cancel it and create a new one. Refer to the documentation for details: http://developer.android.com/reference/android/app/PendingIntent.html#FLAG_CANCEL_CURRENT

提交回复
热议问题