关于java:Android:上下文是否会影响用于取消警报的filterEquals()?

Android: Does context affect filterEquals(), used to cancel alarm?

要取消警报,我使用alarmManager.cancel(pendingIntent);,根据android开发人员的说法Removes any alarms with a matching Intent. Any alarm, of any type, whose Intent matches this one (as defined by filterEquals(Intent)), will be canceled.

如果它比较2个使用不同上下文构造的pendingIntent,并且它们使用的intent也具有不同的上下文,但是它们引用的类相同,则filterEquals(Intent)返回true吗?

因此,pendingIntent1具有:context1和具有context1和class1.class

的意图

andendingIntent2具有:context2和具有context2和class1.class

的意图

预先感谢!


我认为它们应该相同。据此,仅需要上下文来检索应用程序的程序包名称。