Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
LocationManager locationManager = (LocationManager) getActivity().getSystemService(LOCATION_SERVICE);
//Get current location to start with
Location myLocation = locationManager.getLastKnownLocation(LocationManager.PASSIVE_PROVIDER);
currentLatitude = myLocation.getLatitude();
currentLongitude = myLocation.getLongitude();
// Request location update using LocationManager.NETWORK_PROVIDER
locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER,
MIN_TIME_BW_UPDATES,
MIN_DISTANCE_CHANGE_FOR_UPDATES, MapFragment.this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment