I am building an app that uses Location Manager and proximity alerts. No problem with this.
Say I add a proximity alert
How do I remove it later?
Now you may say "use removerProximityAlert". Fair enough.
But this function needs the pending intent that the alert was created with so I can do that if my activity is on the foreground and I have that intent.
Maybe (I am not sure really-can I?) I can do that even if the activity goes to background so it pauses and restart again.. - is the pending intent still there?
But what about if the activity gets destroyed? - Say I change the tablet orientation.
Then the intent is gone so how can I remove that proximity alert?
Say I add a proximity alert
Code:
locationManager.addProximityAlert(latitude,
longitude,
radius,
-1,
pendingIntent);
How do I remove it later?
Now you may say "use removerProximityAlert". Fair enough.
But this function needs the pending intent that the alert was created with so I can do that if my activity is on the foreground and I have that intent.
Maybe (I am not sure really-can I?) I can do that even if the activity goes to background so it pauses and restart again.. - is the pending intent still there?
But what about if the activity gets destroyed? - Say I change the tablet orientation.
Then the intent is gone so how can I remove that proximity alert?