取消所有接近警报

取消所有接近警报

本文介绍了取消所有接近警报的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

的LocationManager 提供了方法 removeProximityAlert(的PendingIntent),但一个人如何删除ProximityAlert(或者干脆所有的人),当你不能再拥有的句柄的PendingIntent ?该GPS图标仍然在状态栏中,我已经设置了ProximityAlert没有过期。

The LocationManager provides the method removeProximityAlert(PendingIntent), but how does one remove a ProximityAlert (or simply all of them) when you no longer have a handle to the PendingIntent? The GPS icon remains in the status bar, and I have set no expiration for the ProximityAlert.

卸载产生它并不能帮助应用程序。

Uninstalling the application that spawned it does not help.

推荐答案

创建一个相当于的PendingIntent ,在同类型的(例如, getBroadcast ()),并包裹等效意图(即,一个具有相同的动作,数据类型和组件 - 不管那你设置本来)。然后,使用该的PendingIntent 删除您接近警报。

Create an equivalent PendingIntent, one of the same type (e.g., getBroadcast()) and wraps an equivalent Intent (i.e., one with the same action, data, type, and component -- whatever of that you set originally). Then, use this PendingIntent to remove your proximity alerts.

另外请注意,GPS图标始终停留在仿真器;仅在硬件将GPS图标真实地反映GPS无线电的状态。

Also note that the GPS icon always stays on for the emulator; only on hardware will the GPS icon truly reflect the status of the GPS radio.

这篇关于取消所有接近警报的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-28 02:16