Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
android
/
dayu
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
2baca7b6
authored
Jan 05, 2018
by
罗翻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
定位
parent
ed9cd68c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
10 deletions
app/src/main/java/com/dayu/bigfish/utils/LocationUtils.java
app/src/main/java/com/dayu/bigfish/utils/LocationUtils.java
View file @
2baca7b6
...
...
@@ -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
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment