version:MTK 3.6
fix: update:GPS定位成功后关闭
This commit is contained in:
@@ -88,8 +88,8 @@ android {
|
|||||||
//MTK
|
//MTK
|
||||||
MTKnewly {
|
MTKnewly {
|
||||||
flavorDimensions "default"
|
flavorDimensions "default"
|
||||||
versionCode 26
|
versionCode 27
|
||||||
versionName "3.5"
|
versionName "3.6"
|
||||||
buildConfigField "String", "platform", '"MTK"'
|
buildConfigField "String", "platform", '"MTK"'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.aoleyun.sn.manager;
|
|||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.provider.Settings;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.aoleyun.sn.utils.SPUtils;
|
import com.aoleyun.sn.utils.SPUtils;
|
||||||
@@ -41,6 +42,7 @@ public class MapManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void initMap() {
|
public void initMap() {
|
||||||
|
Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED, "+gps");
|
||||||
mLocationClient = new LocationClient(mContext);
|
mLocationClient = new LocationClient(mContext);
|
||||||
mLocationClient.setLocOption(getDefaultLocationClientOption());
|
mLocationClient.setLocOption(getDefaultLocationClientOption());
|
||||||
mLocationClient.registerLocationListener(mListener);
|
mLocationClient.registerLocationListener(mListener);
|
||||||
@@ -49,6 +51,7 @@ public class MapManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public LocationClient getLocationClient() {
|
public LocationClient getLocationClient() {
|
||||||
|
Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED, "+gps");
|
||||||
if (mLocationClient == null) {
|
if (mLocationClient == null) {
|
||||||
initMap();
|
initMap();
|
||||||
}
|
}
|
||||||
@@ -123,6 +126,8 @@ public class MapManager {
|
|||||||
}
|
}
|
||||||
Log.e(TAG, "MapAddress: " + (String) SPUtils.get(mContext, "MapAddress", "-"));
|
Log.e(TAG, "MapAddress: " + (String) SPUtils.get(mContext, "MapAddress", "-"));
|
||||||
Log.e(TAG, "MapError: " + (String) SPUtils.get(mContext, "MapError", "-"));
|
Log.e(TAG, "MapError: " + (String) SPUtils.get(mContext, "MapError", "-"));
|
||||||
|
// Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED, "-network");
|
||||||
|
Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED, "-gps");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user