Skip to content

Commit 265a609

Browse files
committed
合规修复-按照地图sdk侧提的建议改成单次定位接口。
Change-Id: Id285e8f6fe53e81530f935fdd6c9d4e42cddca75
1 parent 13bad76 commit 265a609

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/src/main/java/com/tencent/iot/explorer/link/kitlink/activity/MarkerPaddingActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public class MarkerPaddingActivity extends BaseActivity implements TencentMap.On
6969

7070
private final int PAGE_SIZE = 20;
7171
private PermissionDialog permissionDialog = null;
72-
private final String[] permissions = {permission.ACCESS_COARSE_LOCATION};
72+
private final String[] permissions = {permission.ACCESS_COARSE_LOCATION, permission.ACCESS_FINE_LOCATION};
7373
public MapView mMapView;
7474
private TencentMap mTencentMap;
7575
private RecyclerView recyclerView;
@@ -208,7 +208,7 @@ private void startLocation() {
208208
//设置为true表示显示定位层并可触发定位,false表示隐藏定位层并不可触发定位,默认是false
209209
mTencentMap.setMyLocationEnabled(true);
210210

211-
int err = locationManager.requestLocationUpdates(locationRequest, this, Looper.myLooper());
211+
int err = locationManager.requestSingleFreshLocation(locationRequest, this, Looper.myLooper());
212212
switch (err) {
213213
case 1:
214214
case 2:

0 commit comments

Comments
 (0)