我尝试在onLocationChanged函数的更新中获得正确的速度,这是我的类:
public class LocationService extends Service implements LocationListener {
Run Code Online (Sandbox Code Playgroud)
将minTime放在6000上并没有帮助,它会不断更新,我做错了什么?
public void requestLocationUpdates (String provider, long minTime, float minDistance, LocationListener listener, Looper looper) {
Run Code Online (Sandbox Code Playgroud)
问候
我正在使用网络位置提供商.我需要每隔 1小时从我的LocationListener调用一次onLocationChanged方法.这是我的代码:
MyLocationListener locationListener = new MyLocationListener();
locationMangaer.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 3600000, 0,locationListener);
Run Code Online (Sandbox Code Playgroud)
但它不起作用.我onLocationChanged经常打电话.
我必须使用哪些参数?