安卓:有没有背景影响filterEquals(),用于取消报警?背景、filterEquals

由网友(①嗰亽①蓙城①玍吢疼)分享简介:要取消闹铃,我用 alarmManager.cancel(pendingIntent); ,据Android开发删除与匹配的意图的任何警报。任何类型的,其意图这一个(由filterEquals定义(意图))匹配任何报警,将被取消。 To cancel an alarm, I use alarmManager.canc...

要取消闹铃,我用 alarmManager.cancel(pendingIntent); ,据Android开发删除与匹配的意图的任何警报。任何类型的,其意图这一个(由filterEquals定义(意图))匹配任何报警,将被取消。

To cancel an alarm, I use alarmManager.cancel(pendingIntent); which, according to android developers 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 pendingIntents,但它们引用的类是相同的,确实filterEquals(意向)返回真?

If it compares 2 pendingIntents which are constructed with a different context and the intents they use have a different context as well, but the classes they refer to are the same, does filterEquals(Intent) return true?

所以,pendingIntent1有:CONTEXT1和CONTEXT1和class1.class意图

So, pendingIntent1 has: context1 and an intent with context1 and class1.class

和pendingIntent2有:context2和context2和class1.class意图

And pendingIntent2 has: context2 and an intent with context2 and class1.class

在此先感谢!

推荐答案

我想他们应该是一样的。据这个,上下文只需要检索应用程序的包名。

I think they should be the same. According to this, the context is only needed to retrieve the package name of your application.

阅读全文

相关推荐

最新文章