草庐IT

MyLocationListener

全部标签

android - 融合的位置提供程序 setsmallestDisplacement 在 Android 中不起作用

您好,我已经实现了FusedLocation提供程序Api,用于在服务中获取位置更新。我能够根据设置的时间间隔触发onlocationchanged事件。但是,当我将setsmallestDisplacement设置为10米时,即使设备静止,事件也会被触发。有没有人有类似的问题。请提供建议。下面是代码mlocationrequest=LocationRequest.create();mlocationrequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);mlocationrequest.setInterval(60000

android - 融合的位置提供程序 setsmallestDisplacement 在 Android 中不起作用

您好,我已经实现了FusedLocation提供程序Api,用于在服务中获取位置更新。我能够根据设置的时间间隔触发onlocationchanged事件。但是,当我将setsmallestDisplacement设置为10米时,即使设备静止,事件也会被触发。有没有人有类似的问题。请提供建议。下面是代码mlocationrequest=LocationRequest.create();mlocationrequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);mlocationrequest.setInterval(60000