Android - Google Geofence API - Get all the registered geofences
<p>I want to retrieve a list of all the geofences currently active in the system.</p>

<p>I have a list view in which there is a slider button to switch on and off each Geofence</p>

<p>My problem is if the geofence is not triggered and the duration of expiration has passed, then i have no way to update my GUI. Is there any way i can get a callback when android automatically removes the geofence after the setExpirationDuration() method hass been called?</p>

<p>I tried using database to keep a track of the duration and the status of the geofence whether its in the system or not but when the user restarts the phone all the geofences are unregistered and hence my application shows the Geofences are registered(since i haven't updated the database) even though there are no active geofences.</p>

<p>i tried scheduling a job for updating the GUI when the expiration time has passed but this method also fails if there is a system restart.</p>

<p>is there any way that i can run some code on system restart so that i can make changes to my database?</p>

<p>Thank you.</p>