Skip to content Skip to sidebar Skip to footer

Java Errors In Android App

I'm trying to to implement a addProximityAlert when an info window is clicked googleMap.setOnInfoWindowClickListener( new OnInfoWindowClickListener(){ p

Solution 1:

You have two merged method declarations:

publicvoidonInfoWindowClick(Marker marker){

publicvoidaddProximityAlert(double latitude, double longitude){

Not sure what your intent is, but you need to close off the declaration of onInfoWindowClick(Marker marker) before beginning the declaration of addProximityAlert

Solution 2:

Try it like this:

googleMap.setOnInfoWindowClickListener(
                newOnInfoWindowClickListener(){
                    publicvoidonInfoWindowClick(Marker marker) {

                        addProximityAlert(latitude,longitude);
         }

    });

 publicvoidaddProximityAlert(double latitude, double longitude){


         LatLngclickedMarkerLatLng= marker.getPosition();
                doublelat=  clickedMarkerLatLng.latitude;
                doublelong1=  clickedMarkerLatLng.longitude;

            Log.e("hello", "Output=" + lat + long1);

               LocationManager lm;
         //   double lat=123,long1=34;    //Defining Latitude & Longitudefloat radius=30;                         //Defining RadiusIntentintent=newIntent(PROX_ALERT_INTENT);
        PendingIntentproximityIntent= PendingIntent.getBroadcast(this, 0, intent, 0);
        locationManager.addProximityAlert(
            lat, // the latitude of the central point of the alert region
            long1, // the longitude of the central point of the alert region
            POINT_RADIUS, // the radius of the central point of the alert region, in meters
            PROX_ALERT_EXPIRATION, // time for this proximity alert, in milliseconds, or -1 to indicate no expiration
            proximityIntent // will be used to generate an Intent to fire when entry to or exit from the alert region is detected
       );
       IntentFilterfilter=newIntentFilter(PROX_ALERT_INTENT); 
       registerReceiver(newProximityIntentReceiver(), filter);
    }

Post a Comment for "Java Errors In Android App"