kostmo
kostmo

Reputation: 6340

cancel all proximity alerts

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.

Upvotes: 2

Views: 1788

Answers (1)

CommonsWare
CommonsWare

Reputation: 1007533

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.

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.

Upvotes: 3

Related Questions