1
通過LocationManager.KEY_PROXIMITY_ENTERING不可用於接近警報?
LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
Intent intent = new Intent(Constants.ACTION_PROXIMITY_ALERT);
intent.putExtra(Constants.INTENT_EXTRA_LOCATION, location); // custom payload
PendingIntent pendingIntent = PendingIntent.getService(this, 0, intent, 0);
locationManager.addProximityAlert(location.getLatitude(),
location.getLongitude(), location.getRadius(), -1, pendingIntent);
對於一個給定的座標接近警報註冊後我得到進入或離開配置的位置時提供給我的服務的意圖。到現在爲止還挺好。
不幸的是,這些傳送的意向都沒有攜帶標識位置變化類型(進入或退出)的布爾額外LocationManager.KEY_PROXIMITY_ENTERING
,可通過Intent.getBooleanExtra
檢索。我的觀察是基於AOSP 2.1和AOSP 2.2。根據documentation,此額外應始終存在。
有什麼我錯過了?在模擬器上使用模擬位置運行時,是否存在這種額外限制?
問題似乎仍然存在,因爲4.1.2 ...(facepalm)只是想知道,有人會解決這個問題嗎? –
@deville如果你想看到這個問題,你應該在https://code.google.com/p/android/issues/list上提出一個錯誤問題。 –