0
votes

When i try to enter in the google maps fragment in my app, i would like it to be positioned on the marker of the user who is logged in that moment, in this google map there are all the markers of my app, the problem is that it is positioned on a marker that is not of the user who logged in at that time. For now the google maps center the marker located in India. How can I do? If need something else let me know

 @Override
public void onMapReady(GoogleMap googleMap) {
  
    try{
        for (int i = 0; i < addresses.size(); i++) {
            String user_address = addresses.get(i);
            Log.d(TAG, "onMapReady: position: " + i);
            if (user_address == null) continue;
            if (!user_address.equals("To be added")) {
                String user_gender = genders.get(i);
                latLng = getLocationFromAddress(user_address);
                MarkerOptions markerOptions = new MarkerOptions();
                markerOptions.position(latLng);
                markerOptions.title("You");
                markerOptions.icon(BitmapFromVector(getApplicationContext(), (user_gender.equals("Male")) ? R.drawable.male : R.drawable.female));
                googleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng, 5));
                googleMap.addMarker(markerOptions);
            }
        }