Commit b3f3717e80d573076034873514233b9a3796f61f
1 parent
82781df1
1 卡路里服务增加路径变量
Showing
2 changed files
with
5 additions
and
5 deletions
config.gradle
moudle_pedometer/src/main/java/com/cnlive/moudle/calorie/service/CalorieService.java
| @@ -63,7 +63,7 @@ import java.util.Date; | @@ -63,7 +63,7 @@ import java.util.Date; | ||
| 63 | * @author ShinnyYang | 63 | * @author ShinnyYang |
| 64 | */ | 64 | */ |
| 65 | public class CalorieService extends Service implements SensorEventListener { | 65 | public class CalorieService extends Service implements SensorEventListener { |
| 66 | - | 66 | + public static final String serviceName = "com.cnlive.moudle.calorie.service.CalorieService"; |
| 67 | private String TAG = "CalorieService"; | 67 | private String TAG = "CalorieService"; |
| 68 | /** | 68 | /** |
| 69 | * 通知栏相关 | 69 | * 通知栏相关 |
| @@ -321,12 +321,12 @@ public class CalorieService extends Service implements SensorEventListener { | @@ -321,12 +321,12 @@ public class CalorieService extends Service implements SensorEventListener { | ||
| 321 | Log.e(TAG, "calorieEntity: " + calorieEntity); | 321 | Log.e(TAG, "calorieEntity: " + calorieEntity); |
| 322 | if (null == calorieEntity) { | 322 | if (null == calorieEntity) { |
| 323 | CURRENT_STEP = 0; | 323 | CURRENT_STEP = 0; |
| 324 | - calorieEntity=new CalorieEntity(); | 324 | + calorieEntity = new CalorieEntity(); |
| 325 | calorieEntity.setUuid(CalorieUtil.getUUID()); | 325 | calorieEntity.setUuid(CalorieUtil.getUUID()); |
| 326 | calorieEntity.setCurrentDate(CURRENT_DATE); | 326 | calorieEntity.setCurrentDate(CURRENT_DATE); |
| 327 | calorieEntity.setUserId(userId); | 327 | calorieEntity.setUserId(userId); |
| 328 | - calorieEntity.setStep(CURRENT_STEP+""); | ||
| 329 | - CalorieUtil.insertData(getApplicationContext(),calorieEntity); | 328 | + calorieEntity.setStep(CURRENT_STEP + ""); |
| 329 | + CalorieUtil.insertData(getApplicationContext(), calorieEntity); | ||
| 330 | } else { | 330 | } else { |
| 331 | if (calorieEntity.getStep() != null && !TextUtils.isEmpty(calorieEntity.getStep())) { | 331 | if (calorieEntity.getStep() != null && !TextUtils.isEmpty(calorieEntity.getStep())) { |
| 332 | CURRENT_STEP = Integer.parseInt(calorieEntity.getStep()); | 332 | CURRENT_STEP = Integer.parseInt(calorieEntity.getStep()); |