0

当我像这样执行 requestLocationUpdates 时:

FusedLocationProviderClient fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(context);    

LocationRequest locationRequest = new LocationRequest();
locationRequest.setInterval(150000);
locationRequest.setFastestInterval(30000);
locationRequest.setMaxWaitTime(900000);
locationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY);
locationRequest.setSmallestDisplacement(0);

fusedLocationProviderClient.requestLocationUpdates(locationRequest, getPendingIntent(context));

然后onReceive(Context context, Intent intent)立即被解雇而没有照顾setMaxWaitTime(900000)。这是正常/记录在案的行为吗?

4

1 回答 1

1

LocationUpdatesPendingIntent中有一个小的免责声明:

    // Sets the maximum time when batched location updates are delivered. Updates may be
    // delivered sooner than this interval.
    mLocationRequest.setMaxWaitTime(MAX_WAIT_TIME);
于 2018-10-02T11:16:20.993 回答