PendingIntentFLAG_UPDATE_CURRENT 跟 PendingIntentFLAG_IMMUTABLE 区别
PendingIntent.FLAG_UPDATE_CURRENT 表示如果该PendingIntent已经存在,则保留它并更新它的extra数据,而不是创建一个新的PendingIntent。
PendingIntent.FLAG_IMMUTABLE 表示该PendingIntent的extra数据是不可变的,即不能通过调用getActivity()、getService()、getBroadcast()等方法重新设置extra数据。这个标志可以用来确保无论何时调用getActivity()、getService()、getBroadcast()等方法,都返回相同的PendingIntent实例,从而保持extra数据的一致性。
原文地址: https://www.cveoy.top/t/topic/ixLY 著作权归作者所有。请勿转载和采集!