title: Location on google map in android studio not updating
body: <p>This is my java code in android studio:</p>
  <pre><code>public class MapsActivity extends FragmentActivity implements OnMapReadyCallback {
      FusedLocationProviderClient fusedLocationProviderClient;
      private GoogleMap mMap;
      double lat, lon;
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_maps);
          SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
                  .findFragmentById(R.id.map);
          mapFragment.getMapAsync(this);
  
          fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(MapsActivity.this);
  
          if (ActivityCompat.checkSelfPermission(MapsActivity.this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED &amp;&amp; ActivityCompat.checkSelfPermission(MapsActivity.this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
              getCurrentLocation();
          }else{
              ActivityCompat.requestPermissions(MapsActivity.this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}, 100);
          }}
  
          @Override
          public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
              if (requestCode == 100 &amp;&amp; grantResults.length &gt; 0 &amp;&amp; (grantResults[0] + grantResults[1] == PackageManager.PERMISSION_GRANTED)){
                  getCurrentLocation();
              }
          }
  
          private void getCurrentLocation() {
              LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
              if (locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER) || locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER)) {
  
  
                  if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &amp;&amp; ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
                      // TODO: Consider calling
                      //    ActivityCompat#requestPermissions
                      // here to request the missing permissions, and then overriding
                      //   public void onRequestPermissionsResult(int requestCode, String[] permissions,
                      //                                          int[] grantResults)
                      // to handle the case where the user grants the permission. See the documentation
                      // for ActivityCompat#requestPermissions for more details.
                      return;
                  }
                  fusedLocationProviderClient.getLastLocation().addOnCompleteListener(new OnCompleteListener&lt;Location&gt;() {
                      @Override
                      public void onComplete(@NonNull Task&lt;Location&gt; task) {
                          Location location = task.getResult();
                          if (location != null) {
                              lat = location.getLatitude();
                              lon = location.getLongitude();
                              Toast.makeText(MapsActivity.this, String.valueOf(lat), Toast.LENGTH_SHORT).show();
                              onMapReady(mMap);
                          } else {
                              LocationRequest locationRequest = new LocationRequest().setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY)
                                      .setInterval(3000).setFastestInterval(5000);
                              LocationCallback locationCallback = new LocationCallback() {
                                  @Override
                                  public void onLocationResult(@NonNull LocationResult locationResult) {
                                      Location location1 = locationResult.getLastLocation();
                                      lat = location1.getLatitude();
                                      lon = location1.getLongitude();
                                      Toast.makeText(MapsActivity.this, String.valueOf(lat), Toast.LENGTH_SHORT).show();
                                      onMapReady(mMap);
  
                                  }
                              };
                              if (ActivityCompat.checkSelfPermission(MapsActivity.this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &amp;&amp; ActivityCompat.checkSelfPermission(MapsActivity.this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
                                  // TODO: Consider calling
                                  //    ActivityCompat#requestPermissions
                                  // here to request the missing permissions, and then overriding
                                  //   public void onRequestPermissionsResult(int requestCode, String[] permissions,
                                  //                                          int[] grantResults)
                                  // to handle the case where the user grants the permission. See the documentation
                                  // for ActivityCompat#requestPermissions for more details.
                                  return;
                              }
                              fusedLocationProviderClient.requestLocationUpdates(locationRequest, locationCallback, Looper.getMainLooper());
                          }
                      }
                  });
              }
          }
  
      @Override
      public void onMapReady(GoogleMap googleMap) {
          mMap = googleMap;
          try {
              if(lat != 0.0) {
                  LatLng location = new LatLng(lat, lon);
                  mMap.addMarker(new MarkerOptions().position(location).title(&quot;My location&quot;));
                  googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(location, 16));
              }
          }catch (Exception ignored){
  
          }
  
      }
  }
  </code></pre>
  <p>For some reason the line:</p>
  <pre><code>fusedLocationProviderClient.requestLocationUpdates(locationRequest, locationCallback, Looper.getMainLooper());
  </code></pre>
  <p>doesn't run. The point of this line is to make the method for finding the user location refresh/update every few seconds and output the location on the map. But I am only getting the location when starting the app and the location never refreshes. I'm assuming it's because the fusedLocationProviderClient.requestLocationUpdate line doesn't run.</p>