Created
August 4, 2018 05:56
-
-
Save 100rabhkr/3dad59a9b642482faf4ab6d34ada0cb7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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