我已经设置了这个 LocationRequest
private static final int MILLISECONDS_PER_SECOND = 1000;
public static final int UPDATE_INTERVAL_IN_SECONDS = 5;
private static final long UPDATE_INTERVAL = MILLISECONDS_PER_SECOND * UPDATE_INTERVAL_IN_SECONDS;
private static final int FASTEST_INTERVAL_IN_SECONDS = 1;
private static final long FASTEST_INTERVAL = MILLISECONDS_PER_SECOND * FASTEST_INTERVAL_IN_SECONDS;
mLocationClient = new LocationClient(this, this, this);
mLocationRequestHigh = LocationRequest.create();
mLocationRequestHigh.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
mLocationRequestHigh.setInterval(UPDATE_INTERVAL);
mLocationRequestHigh.setFastestInterval(FASTEST_INTERVAL);
这是在我的 BaseActivity 中设置的,然后在我调用的另一个活动中
mLocationClient.requestLocationUpdates(mLocationRequestHigh, this);
但是,这只是搜索位置,但似乎从未获得位置。我是否错过/做错了什么,或者可能只是我所在的位置?如果我加载谷歌地图,它会在几秒钟内获得我的位置。