在我构建地理围栏的方法中,我收到一个错误ExpirationDuration(NEVER_EXPIRE)
并setTransitionTypes(GEOFENCE_TRANSITION_ENTER)
指出它们无法解析为变量。为什么会这样?
我的方法:
private void buildGeofence(){
LatLng geofencePoint = marker.getPosition();
int radius = 1610;
Geofence.Builder geofence = new Geofence.Builder();
geofence.setCircularRegion(geofencePoint.latitude,geofencePoint.longitude, radius);
geofence.setExpirationDuration(NEVER_EXPIRE);
geofence.setTransitionTypes(GEOFENCE_TRANSITION_ENTER);
geofence.setNotificationResponsiveness(0);
geofence.build();
}