Java Errors in Android App -
i'm trying to implement addproximityalert
when info window clicked
googlemap.setoninfowindowclicklistener( new oninfowindowclicklistener(){ public void oninfowindowclick(marker marker) { public void addproximityalert(double latitude, double longitude){ latlng clickedmarkerlatlng = marker.getposition(); double lat = clickedmarkerlatlng.latitude; double long1 = clickedmarkerlatlng.longitude; log.e("hello", "output=" + lat + long1); locationmanager lm; // double lat=123,long1=34; //defining latitude & longitude float radius=30; //defining radius intent intent = new intent(prox_alert_intent); pendingintent proximityintent = pendingintent.getbroadcast(this, 0, intent, 0); locationmanager.addproximityalert( lat, // latitude of central point of alert region long1, // longitude of central point of alert region point_radius, // radius of central point of alert region, in meters prox_alert_expiration, // time proximity alert, in milliseconds, or -1 indicate no expiration proximityintent // used generate intent fire when entry or exit alert region detected ); intentfilter filter = new intentfilter(prox_alert_intent); registerreceiver(new proximityintentreceiver(), filter); } } });
this has "java errors" , i'm unsure how fix them. apparently in line public void addproximityalert(double latitude, double longitude){
brackets , comma aren't necessary, despite them being needed. can help?
edit: ok, i've implemented of answers below, i'm still having problems. getbroadcast
method undefined type infowindowclicklistener
. suggestions?
you have 2 merged method declarations:
public void oninfowindowclick(marker marker) { public void addproximityalert(double latitude, double longitude){
not sure intent is, need close off declaration of oninfowindowclick(marker marker)
before beginning declaration of addproximityalert
Comments
Post a Comment