0

As the documentation do not specify clearly this behaviour, I'm wondering if one could set both an interval condition AND a smallest displacement condition inside the same LocationRequest to receive updates as soon as one of the two conditions are satisfied :

  1. when the specified delay expires,
  2. when the specified smallestDisplacement is reach
    LocationServices
            .getFusedLocationProviderClient(context)
            .requestLocationUpdates(
                LocationRequest
                    .create()
                    .setInterval(myInterval)
                    .setMaxWaitTime(myInterval)
                    .setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY)
                    .setSmallestDisplacement(myRange), 
                myIntent)  

This code seem to provide updates only when the smallest displacement condition is met AND after the specified interval.

Do you know if I can avoid to use two distinct requests ?

avianey
  • 5,545
  • 3
  • 37
  • 60

0 Answers0