Skip to content

Instantly share code, notes, and snippets.

@jmif
Created September 23, 2011 22:16
Show Gist options
  • Save jmif/1238589 to your computer and use it in GitHub Desktop.
Save jmif/1238589 to your computer and use it in GitHub Desktop.
int location_wait_time = getApplicationContext().getResources()
.getInteger(R.integer.location_poll_minutes);
LocationManager lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
Intent intent = new Intent(this, LocationReceiver.class);
PendingIntent pendingIntent = PendingIntent.getBroadcast(getApplicationContext(),
0, intent, 0);
//Register for broadcast intents
lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1 * 1000 * 60,
0, pendingIntent);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment