我試圖實現一個addProximityAlert
當點擊的Java錯誤在Android應用程序
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, // 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
);
IntentFilter filter = new IntentFilter(PROX_ALERT_INTENT);
registerReceiver(new ProximityIntentReceiver(), filter);
}
}
});
這有「Java的錯誤」的信息窗口,我不確定要如何解決這些問題。顯然,在public void addProximityAlert(double latitude, double longitude){
行中,括號和逗號不是必需的,儘管它們是需要的。有人可以幫忙嗎?
編輯:好的,所以我實現了以下一些問題的答案,但我仍然有問題。該方法getBroadcast
未定義該類型InfoWindowClickListener
。有什麼建議麼?
你已經在方法裏面定義了錯誤的方法 – 2013-03-18 07:24:28