简洁地描述下 Bug。
- AndroidUtilCode 的版本:utilcode 1.27.0
- 出现 Bug 的设备型号:一加6T
- 设备的 Android 版本:API28
PermissionUtils.permission(PermissionContant.ALLPermission).callback(new PermissionUtils.SimpleCallback() {
@Override
public void onGranted() {
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
initSplash();
}
}, ANIMATION_DURATION);
}
@Override
public void onDenied() {
initSplash();
}
}).request();
//判断是否开启定位权限
PermissionUtils.permission(PermissionContant.LocationPERMISSON).callback(new PermissionUtils.SimpleCallback() {
@Override
public void onGranted() {
AMapUtil.initLocation(TakePicCheckInActivity.this, new AMapUtil.LocationListener() {
@Override
public void getLocation(AMapLocation aMapLocation) {
LogUtils.d("签到页定位刷新");
currentLatLng = new LatLng(aMapLocation.getLatitude(), aMapLocation.getLongitude());
outter:
for (CompanySignPointDto pointBean : checkInPointList) {
float distance = AMapUtils.calculateLineDistance(currentLatLng, new LatLng(Double.valueOf(pointBean.getLatitude()), Double.valueOf(pointBean.getLongitude())));
// 两点距离大于半径才显示
noGps(NO_LOCATION);
if (distance < pointBean.getRadius()) {
//物料校验
if (null != wayBillDetailBean && null != pointBean && null != pointBean.getMaterialCodeList() && (pointBean.getMaterialCodeList().contains(wayBillDetailBean.getMaterialCode()) || pointBean.getMaterialCodeList().get(0).equals("ALL"))) {
noGps(IN_LOCATION);
} else {
noGps(NO_LOCATION);
}
break outter;
}
}
}
@Override
public void failureGetLoaction(int errorCode) {
noGps(IN_LOCATION);
}
});
}
@Override
public void onDenied() {
noGps(NO_GPS_PREMISSION);
}
}).request();
异常堆栈
- 初始化获取权限的时候,直接就执行initSplash()的方法,没有延时
- 定位权限获取不到