version:1.2.6
fix: update:修复闪退,优化定位小数问题
This commit is contained in:
@@ -17,8 +17,8 @@ android {
|
|||||||
minSdkVersion 23
|
minSdkVersion 23
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
|
|
||||||
versionCode 26
|
versionCode 27
|
||||||
versionName "1.2.5"
|
versionName "1.2.6"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
|
||||||
|
|||||||
@@ -943,10 +943,20 @@ public class HomeActivity extends BaseMvvmActivity<HomeViewModel, ActivityHomeBi
|
|||||||
|
|
||||||
private void sendNotification() {
|
private void sendNotification() {
|
||||||
if (!ServiceUtils.isServiceRunning(MainService.class)) {
|
if (!ServiceUtils.isServiceRunning(MainService.class)) {
|
||||||
startService(new Intent(HomeActivity.this, MainService.class));
|
Intent intent = new Intent(HomeActivity.this, MainService.class);
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
startForegroundService(intent);
|
||||||
|
} else {
|
||||||
|
startService(intent);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!ServiceUtils.isServiceRunning(SocketService.class)) {
|
if (!ServiceUtils.isServiceRunning(SocketService.class)) {
|
||||||
startService(new Intent(HomeActivity.this, SocketService.class));
|
Intent intent = new Intent(HomeActivity.this, SocketService.class);
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
startForegroundService(intent);
|
||||||
|
} else {
|
||||||
|
startService(intent);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -163,13 +163,13 @@ public class UserActivity extends BaseMvvmActivity<UserViewModel, ActivityUserBi
|
|||||||
|
|
||||||
mViewModel.mAppUpdateInfoData.observe(this, new Observer<AppInfo>() {
|
mViewModel.mAppUpdateInfoData.observe(this, new Observer<AppInfo>() {
|
||||||
@Override
|
@Override
|
||||||
public void onChanged(AppInfo appUpdateInfo) {
|
public void onChanged(AppInfo appInfo) {
|
||||||
if (appUpdateInfo == null) {
|
if (appInfo == null) {
|
||||||
// Toaster.show("已是最新版本");
|
// Toaster.show("已是最新版本");
|
||||||
} else {
|
} else {
|
||||||
if (ApkUtils.isUpdate(UserActivity.this, appUpdateInfo)) {
|
if (ApkUtils.isUpdate(UserActivity.this, appInfo)) {
|
||||||
Intent intent = new Intent(UserActivity.this, UpdateActivity.class);
|
Intent intent = new Intent(UserActivity.this, UpdateActivity.class);
|
||||||
intent.putExtra("appUpdateInfo", appUpdateInfo);
|
intent.putExtra("appInfo", appInfo);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
Toaster.show("有新的版本需要更新");
|
Toaster.show("有新的版本需要更新");
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ public class BaseApplication extends Application {
|
|||||||
AdminManager.init(this);
|
AdminManager.init(this);
|
||||||
|
|
||||||
|
|
||||||
CrashReport.initCrashReport(getApplicationContext(), "4efcaad4c9", false);
|
CrashReport.initCrashReport(getApplicationContext(), "4d42cfdef5", false);
|
||||||
CrashReport.setDeviceId(BaseApplication.this, AdminManager.getInstance().getSerial());
|
CrashReport.setDeviceId(BaseApplication.this, AdminManager.getInstance().getSerial());
|
||||||
|
|
||||||
// 初始化 Toast 框架
|
// 初始化 Toast 框架
|
||||||
|
|||||||
@@ -53,13 +53,13 @@ public class DeviceFragment extends BaseMvvmFragment<DeviceViewModel, FragmentDe
|
|||||||
protected void initData(Bundle savedInstanceState) {
|
protected void initData(Bundle savedInstanceState) {
|
||||||
mViewModel.mAppUpdateInfoData.observe(this, new Observer<AppInfo>() {
|
mViewModel.mAppUpdateInfoData.observe(this, new Observer<AppInfo>() {
|
||||||
@Override
|
@Override
|
||||||
public void onChanged(AppInfo appUpdateInfo) {
|
public void onChanged(AppInfo appInfo) {
|
||||||
if (appUpdateInfo == null) {
|
if (appInfo == null) {
|
||||||
Toaster.show("已是最新版本");
|
Toaster.show("已是最新版本");
|
||||||
} else {
|
} else {
|
||||||
if (ApkUtils.isUpdate(mContext, appUpdateInfo)) {
|
if (ApkUtils.isUpdate(mContext, appInfo)) {
|
||||||
Intent intent = new Intent(mContext, UpdateActivity.class);
|
Intent intent = new Intent(mContext, UpdateActivity.class);
|
||||||
intent.putExtra("appUpdateInfo", appUpdateInfo);
|
intent.putExtra("appInfo", appInfo);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
Toaster.show("有新的版本需要更新");
|
Toaster.show("有新的版本需要更新");
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import com.xwad.os.network.NetInterfaceManager;
|
|||||||
import com.xwad.os.utils.ActivationUtil;
|
import com.xwad.os.utils.ActivationUtil;
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
import io.reactivex.rxjava3.annotations.NonNull;
|
import io.reactivex.rxjava3.annotations.NonNull;
|
||||||
import io.reactivex.rxjava3.core.Observer;
|
import io.reactivex.rxjava3.core.Observer;
|
||||||
@@ -235,8 +236,8 @@ public class AmapManager {
|
|||||||
private void saveMapResult(MapBean mapBean) {
|
private void saveMapResult(MapBean mapBean) {
|
||||||
Log.e(TAG, "saveMapResult: " + GsonUtils.toJSONString(mapBean));
|
Log.e(TAG, "saveMapResult: " + GsonUtils.toJSONString(mapBean));
|
||||||
mMMKV.encode(CommonConfig.MAP_LOCATION_JSON_KEY, GsonUtils.toJSONString(mapBean));
|
mMMKV.encode(CommonConfig.MAP_LOCATION_JSON_KEY, GsonUtils.toJSONString(mapBean));
|
||||||
mMMKV.encode(CommonConfig.MAP_LONGITUDE_KEY, mapBean.getLongitude());
|
mMMKV.encode(CommonConfig.MAP_LONGITUDE_KEY, doubleToStringExact(mapBean.getLongitude()));
|
||||||
mMMKV.encode(CommonConfig.MAP_LATITUDE_KEY, mapBean.getLatitude());
|
mMMKV.encode(CommonConfig.MAP_LATITUDE_KEY, doubleToStringExact(mapBean.getLatitude()));
|
||||||
mMMKV.encode(CommonConfig.MAP_ADDRESS_KEY, mapBean.getAddress());
|
mMMKV.encode(CommonConfig.MAP_ADDRESS_KEY, mapBean.getAddress());
|
||||||
mMMKV.encode(CommonConfig.MAP_PROVINCE_KEY, mapBean.getProvince());
|
mMMKV.encode(CommonConfig.MAP_PROVINCE_KEY, mapBean.getProvince());
|
||||||
mMMKV.encode(CommonConfig.MAP_CITY_KEY, mapBean.getCity());
|
mMMKV.encode(CommonConfig.MAP_CITY_KEY, mapBean.getCity());
|
||||||
@@ -245,4 +246,8 @@ public class AmapManager {
|
|||||||
mMMKV.encode(CommonConfig.MAP_LOCATION_DESCRIBE_KEY, mapBean.getLocationDescribe());
|
mMMKV.encode(CommonConfig.MAP_LOCATION_DESCRIBE_KEY, mapBean.getLocationDescribe());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String doubleToStringExact(double value) {
|
||||||
|
// 使用 BigDecimal 避免科学计数法
|
||||||
|
return new BigDecimal(Double.toString(value)).toPlainString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -251,7 +251,7 @@ public class ManagerService extends Service implements NetworkUtils.OnNetworkSta
|
|||||||
if (!isServiceRunning) {
|
if (!isServiceRunning) {
|
||||||
startService(new Intent(this, MainService.class));
|
startService(new Intent(this, MainService.class));
|
||||||
}
|
}
|
||||||
bindService(new Intent(this, MainService.class), mServiceConnection, Context.BIND_IMPORTANT);
|
// bindService(new Intent(this, MainService.class), mServiceConnection, Context.BIND_IMPORTANT);
|
||||||
|
|
||||||
PushServiceFactory.getPushControlService().setConnectionChangeListener(new PushControlService.ConnectionChangeListener() {
|
PushServiceFactory.getPushControlService().setConnectionChangeListener(new PushControlService.ConnectionChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
@@ -802,7 +802,7 @@ public class ManagerService extends Service implements NetworkUtils.OnNetworkSta
|
|||||||
soundPool.release();
|
soundPool.release();
|
||||||
soundPool = null;
|
soundPool = null;
|
||||||
}
|
}
|
||||||
unbindService(mServiceConnection);
|
// unbindService(mServiceConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user