Commit 2baca7b6 by 罗翻

定位

parent ed9cd68c
......@@ -7,6 +7,9 @@ import com.amap.api.location.AMapLocationClient;
import com.amap.api.location.AMapLocationClientOption;
import com.amap.api.location.AMapLocationListener;
import java.util.concurrent.TimeUnit;
import io.reactivex.Observable;
import io.reactivex.disposables.Disposable;
/**
......@@ -74,16 +77,16 @@ public class LocationUtils {
return;
}
flag = true;
//刷新有时不回调.
// mDisposable = Observable.timer(8000, TimeUnit.MILLISECONDS)
// .subscribe(aLong -> {
// if (flag) {
//// ToastUtils.showShortToast("获取定位失败");
// mListener.result(null);
// flag = false;
// mlocationClient.stopLocation();
// }
// });
// 刷新有时不回调.
mDisposable = Observable.timer(8000, TimeUnit.MILLISECONDS)
.subscribe(aLong -> {
if (flag) {
// ToastUtils.showShortToast("获取定位失败");
mListener.result(null);
flag = false;
mlocationClient.stopLocation();
}
});
time = System.currentTimeMillis();
mlocationClient.setLocationListener(new AMapLocationListener() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment