GeofencerStateMachine: sendNewLocationAvailability: Некоторое время для Geofence добавлено не будет, поэтому Geofence не запускается - PullRequest
0 голосов
/ 05 июля 2019

Геозона не запускается несколько раз (в случайном порядке). Когда я проверяю, в журналах не виден следующий журнал

GeofencerStateMachine: sendNewLocationAvailability: availability=LocationAvailability[isLocationAvailable: true]

для тех геозон, которые не сработали. но он пришел к геозонам, которые сработали.

GeofencingClient mGeofencingClient = LocationServices.getGeofencingClient(this);

Geofence geofence = new Geofence.Builder()
    .setRequestId(tempKey)
    .setCircularRegion(lats[i], lngs[i], radius[i])
    .setExpirationDuration(Geofence.NEVER_EXPIRE) //Never Expires
    .setTransitionTypes(Geofence.GEOFENCE_TRANSITION_ENTER | Geofence.GEOFENCE_TRANSITION_EXIT)
    .build();

geofencingRequest = new GeofencingRequest.Builder()
    .setInitialTrigger(GeofencingRequest.INITIAL_TRIGGER_ENTER | GeofencingRequest.INITIAL_TRIGGER_DWELL)
    .addGeofence(geofence)
    .build();

PendingIntent mGeofencePendingIntent = PendingIntent
    .getBroadcast(currentActivity, 0, geolocationIntent, PendingIntent.FLAG_UPDATE_CURRENT);

mGeofencingClient.addGeofences(geofencingRequest, mGeofencePendingIntent);

Что я должен сделать, чтобы получить NewLocationAvailability, чтобы моя геозона срабатывала каждый раз?

...