Hi Davy, I'm researching doing something similar.
Have you seen this method: http://developer.android.com/reference/com/google/android/gms/location/LocationClient.html#removeLocationUpdates(android.app.PendingIntent) ..it seems to be the counterpart of the method you are calling in your question, namely: http://developer.android.com/reference/com/google/android/gms/location/LocationClient.html#requestLocationUpdates(com.google.android.gms.location.LocationRequest,%20android.app.PendingIntent) Thanks, Shiraz. On Friday, 28 June 2013 10:40:46 UTC+1, Davy wrote: > > Assuming my application uses a PendingIntent to request background > location updates from the new Google Location APIs (Google Play Services) > like this : > > locationclient = new LocationClient(this,this,this); >> locationclient.connect(); >> Intent intentService = new Intent(this,LocationService.class); >> PendingIntent pendingIntent = PendingIntent.getService(this, 1, >> intentService, 0); >> locationrequest = LocationRequest.create(); >> locationrequest.setInterval(100); >> locationclient.requestLocationUpdates(locationrequest, pendingIntent); > > > And imagine a scenario where the user started the app and clicked a button > to start the background location updates, exits the app and comes back at a > later point in time. > > Is it possible for my application to query the Location APIs or the > Android Intent mechanism to know if it has in fact already requested > location updates using this PendingIntent (detecting if this pending intent > is "active") ? > > Or should that be part of my application state (storing the "start" action > somewhere in sharedprefs or another mechanism). But in that case, if the > user decides to clear the cache/data associated with my app, this state > would be lost, while the pending intent might still be active) ? > > What would be a good way of dealing with that ? > > Thanks... > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

