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
88db9469
authored
Aug 02, 2018
by
罗翻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更改locationUtils
parent
aa59c105
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
locationComponent/src/main/java/com/dayu/location/base/LocationUtils.java
locationComponent/src/main/java/com/dayu/location/base/LocationUtils.java
View file @
88db9469
package
com
.
dayu
.
location
.
base
;
import
android.annotation.SuppressLint
;
import
android.content.ActivityNotFoundException
;
import
android.content.Context
;
import
android.content.Intent
;
...
...
@@ -20,12 +21,11 @@ import java.io.File;
*/
public
class
LocationUtils
{
@SuppressLint
(
"StaticFieldLeak"
)
private
static
AMapLocationClient
mlocationClient
;
private
static
AMapLocation
sLocation
=
null
;
private
static
boolean
flag
=
true
;
private
static
MyLocationListener
mListener
;
private
static
Handler
mHandler
;
private
static
OpenMarketListener
marketListener
;
/**
* @param context
...
...
@@ -75,8 +75,7 @@ public class LocationUtils {
* @Title: getCurrentLocation
* @Description: 获取位置,重新发起获取位置请求
*/
public
static
void
getCurrentLocation
(
MyLocationListener
listener
)
{
mListener
=
listener
;
public
static
void
getCurrentLocation
(
final
MyLocationListener
listener
)
{
if
(
mlocationClient
==
null
)
{
return
;
}
...
...
@@ -87,7 +86,7 @@ public class LocationUtils {
@Override
public
void
run
()
{
if
(
flag
)
{
mL
istener
.
result
(
sLocation
);
l
istener
.
result
(
sLocation
);
flag
=
false
;
mlocationClient
.
stopLocation
();
}
...
...
@@ -102,7 +101,7 @@ public class LocationUtils {
flag
=
false
;
mlocationClient
.
stopLocation
();
sLocation
=
location
;
mL
istener
.
result
(
location
);
l
istener
.
result
(
location
);
mHandler
=
null
;
}
}
...
...
@@ -120,7 +119,6 @@ public class LocationUtils {
if
(
mlocationClient
!=
null
)
{
mlocationClient
.
onDestroy
();
}
mListener
=
null
;
}
/**
...
...
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