1

alarmManager.cancel(pendingIntent);Android開発者によると、アラームをキャンセルするには、 which を使用します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 を比較し、それらが使用するインテントも異なるコンテキストを持ちますが、それらが参照するクラスは同じである場合、filterEquals(Intent) は true を返しますか?

したがって、pendingIntent1 には、context1 と、context1 および class1.class を含むインテントがあります。

そして pendingIntent2 には、context2 と、context2 と class1.class を持つインテントがあります。

前もって感謝します!

4

1 に答える 1

3

それらは同じであるべきだと思います。thisによると、コンテキストはアプリケーションのパッケージ名を取得するためにのみ必要です。

于 2012-12-09T11:58:32.057 に答える