79582514

Date: 2025-04-19 14:52:45
Score: 9.5 🚩
Natty: 5
Report link

Can someone help me please,

I want to show all markers with the keyword " hospital" for example on launch activity my map should zoom to my location and show all the hospitals in that area

how can I get that ?

  private void fetchLocation() {
        if (ActivityCompat.checkSelfPermission(
                this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(
                this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
            ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, REQUEST_CODE);
            return;
        }
        Task<Location> task = fusedLocationProviderClient.getLastLocation();
        task.addOnSuccessListener(location -> {
            if (location != null) {
                currentLocation = location;
                Toast.makeText(getApplicationContext(), currentLocation.getLatitude() + "" + currentLocation.getLongitude(), Toast.LENGTH_SHORT).show();
                SupportMapFragment supportMapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.myMap);
                assert supportMapFragment != null;
                supportMapFragment.getMapAsync(MosqueActivity.this);

            }
        });
    }
    @Override
    public void onMapReady(GoogleMap googleMap) {
        LatLng latLng = new LatLng(currentLocation.getLatitude(), currentLocation.getLongitude());
        MarkerOptions markerOptions = new MarkerOptions().position(latLng).title("Your Location");
        googleMap.animateCamera(CameraUpdateFactory.newLatLng(latLng));
        googleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng, 12));
        googleMap.addMarker(markerOptions);

    }
Reasons:
  • Blacklisted phrase (0.5): how can I
  • Blacklisted phrase (1): help me
  • RegEx Blacklisted phrase (3): Can someone help me
  • RegEx Blacklisted phrase (1): I want
  • RegEx Blacklisted phrase (2): help me please
  • Long answer (-1):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Starts with a question (0.5): Can someone help me please
  • Low reputation (1):
Posted by: Futurelinx Informatique