Skip to content

Instantly share code, notes, and snippets.

@ecgreb
Last active August 29, 2015 14:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ecgreb/98e406eaef43149ab9ce to your computer and use it in GitHub Desktop.
Save ecgreb/98e406eaef43149ab9ce to your computer and use it in GitHub Desktop.
private void onLocationClientConnected() {
Location lastLocation = locationClient.getLastLocation();
if (lastLocation != null) {
// do stuff
}
LocationRequest locationRequest = LocationRequest.create();
locationRequest.setInterval(5000);
locationClient.requestLocationUpdates(locationRequest,
new LocationListener() {
@Override public void onLocationChanged(Location location) {
// do more stuff
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment