Android - Why use pending intents for geofences -


i finished tutorial geofencing on android (http://developer.android.com/training/location/geofencing.html) , wonder why 'callback' geofences done via pending intents , not simple callback interface.

if implemented in activity, 1 disconnect location client in onpause() anyway, added geofences not tracked either after application paused/was destroyed, why pending intent? or mistaken here?

i wonder why 'callback' geofences done via pending intents , not simple callback interface.

mostly because geofences designed work without application running.

if implemented in activity, 1 disconnect location client in onpause() anyway, added geofences not tracked either after application paused/was destroyed, why pending intent? or mistaken here?

i believe mistaken here. in fact, geofences not designed directly triggering ui, discussed in the documentation:

the intent sent location services can trigger various actions in app, should not have start activity or fragment, because components should become visible in response user action.

now, might elect want use geofences while have activity in foreground. however, have remove geofences in onpause(). geofence remain registered until expiration time or manually removed, afaict.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -