Commit 47b15bb5816d676e7b2dfcc791dc5826af1e1c34
1 parent
c19c91bc
1 路径工具
Showing
4 changed files
with
31 additions
and
26 deletions
moudle_pedometer/src/main/AndroidManifest.xml
| ... | ... | @@ -119,20 +119,18 @@ |
| 119 | 119 | |
| 120 | 120 | <activity |
| 121 | 121 | android:name="com.cnlive.moudle.pedometer.ui.activity.PedometerMainActivity" |
| 122 | - android:launchMode="singleTask" | |
| 123 | - android:process=":step" /> | |
| 122 | + android:launchMode="singleTask" /> | |
| 123 | + | |
| 124 | 124 | <activity |
| 125 | 125 | android:name="com.cnlive.moudle.pedometer.ui.activity.RunningMapActivity" |
| 126 | - android:launchMode="singleTask" | |
| 127 | - android:process=":step" /> <!-- android:theme="@style/Theme.AppCompat.Light.NoActionBar" --> | |
| 126 | + android:launchMode="singleTask" /> <!-- android:theme="@style/Theme.AppCompat.Light.NoActionBar" --> | |
| 127 | + <!--android:process=":step"--> | |
| 128 | 128 | <activity |
| 129 | 129 | android:name="com.cnlive.moudle.pedometer.ui.activity.RunRaceDetailActivity" |
| 130 | - android:launchMode="singleTask" | |
| 131 | - android:process=":step" /> | |
| 130 | + android:launchMode="singleTask" /> | |
| 132 | 131 | <activity |
| 133 | 132 | android:name="com.cnlive.moudle.pedometer.ui.activity.RunningFinishActivity" |
| 134 | - android:launchMode="singleTask" | |
| 135 | - android:process=":step" /> | |
| 133 | + android:launchMode="singleTask" /> | |
| 136 | 134 | <activity |
| 137 | 135 | android:name="com.cnlive.moudle.pedometer.ui.activity.UploadFailDetailActivity" |
| 138 | 136 | android:launchMode="singleTask" /> |
| ... | ... | @@ -156,7 +154,6 @@ |
| 156 | 154 | android:enabled="true" |
| 157 | 155 | android:exported="true" |
| 158 | 156 | android:priority="1000" |
| 159 | - android:process=":step" | |
| 160 | 157 | android:stopWithTask="false"> |
| 161 | 158 | <intent-filter> |
| 162 | 159 | |
| ... | ... | @@ -186,21 +183,11 @@ |
| 186 | 183 | </intent-filter> |
| 187 | 184 | </receiver> |
| 188 | 185 | |
| 189 | - <activity | |
| 190 | - android:name="com.cnlive.moudle.collectionTrace.ui.activity.CollPedometerMainActivity" | |
| 191 | - android:process=":step" /> | |
| 192 | - <activity | |
| 193 | - android:name="com.cnlive.moudle.collectionTrace.ui.activity.CollRunningFinishActivity" | |
| 194 | - android:process=":step" /> <!-- android:theme="@style/Theme.AppCompat.Light.NoActionBar" --> | |
| 195 | - <activity | |
| 196 | - android:name="com.cnlive.moudle.collectionTrace.ui.activity.CollRunningMapActivity" | |
| 197 | - android:process=":step" /> | |
| 198 | - <activity | |
| 199 | - android:name="com.cnlive.moudle.collectionTrace.ui.activity.CollRunRaceDetailActivity" | |
| 200 | - android:process=":step" /> | |
| 201 | - <activity | |
| 202 | - android:name="com.cnlive.moudle.collectionTrace.ui.activity.StartCollectTraceActivity" | |
| 203 | - android:process=":step" /> | |
| 186 | + <activity android:name="com.cnlive.moudle.collectionTrace.ui.activity.CollPedometerMainActivity" /> | |
| 187 | + <activity android:name="com.cnlive.moudle.collectionTrace.ui.activity.CollRunningFinishActivity" /> <!-- android:theme="@style/Theme.AppCompat.Light.NoActionBar" --> | |
| 188 | + <activity android:name="com.cnlive.moudle.collectionTrace.ui.activity.CollRunningMapActivity" /> | |
| 189 | + <activity android:name="com.cnlive.moudle.collectionTrace.ui.activity.CollRunRaceDetailActivity" /> | |
| 190 | + <activity android:name="com.cnlive.moudle.collectionTrace.ui.activity.StartCollectTraceActivity" /> | |
| 204 | 191 | </application> |
| 205 | 192 | |
| 206 | 193 | </manifest> |
| 207 | 194 | \ No newline at end of file | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/frame/view/CollRunningMapFragmentView.java
| ... | ... | @@ -95,7 +95,6 @@ public class CollRunningMapFragmentView implements MvpView, SensorEventListener |
| 95 | 95 | uid = CollCommonInfo.getUserId(getContext()); |
| 96 | 96 | userStepEntity = CollStepUtil.getCollUserStepData(getContext(), uid); |
| 97 | 97 | //在地图上显示起点 |
| 98 | - | |
| 99 | 98 | //设置数据 |
| 100 | 99 | if (userStepEntity != null) { |
| 101 | 100 | //设置赛事标题 |
| ... | ... | @@ -121,7 +120,8 @@ public class CollRunningMapFragmentView implements MvpView, SensorEventListener |
| 121 | 120 | initChrom(); |
| 122 | 121 | //初始化起点 |
| 123 | 122 | overlays = new ArrayList<>(); |
| 124 | - //打起点 | |
| 123 | + //打起点(重新获取数据) | |
| 124 | + userStepEntity = CollStepUtil.getCollUserStepData(getContext(), uid); | |
| 125 | 125 | if (!TextUtils.isEmpty(userStepEntity.getCollStartLatLng())) { |
| 126 | 126 | LatLng startLatLng = GsonUtil.GsonToBean(userStepEntity.getCollStartLatLng(), LatLng.class); |
| 127 | 127 | if (null != startLatLng) { | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/service/CollStepService.java
| ... | ... | @@ -364,6 +364,8 @@ public class CollStepService extends Service implements SensorEventListener { |
| 364 | 364 | public int onStartCommand(Intent intent, int flags, int startId) { |
| 365 | 365 | userId = CollCommonInfo.getUserId(getApplicationContext()); |
| 366 | 366 | if (userId != null && !TextUtils.isEmpty(userId)) { |
| 367 | + //初始化数据库 | |
| 368 | + CollStepUtil.initCollDataBase(getApplicationContext(), userId); | |
| 367 | 369 | if (!EventBus.getDefault().isRegistered(this)) { |
| 368 | 370 | EventBus.getDefault().register(this); |
| 369 | 371 | } | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/utils/CollStepUtil.java
| ... | ... | @@ -33,6 +33,22 @@ public class CollStepUtil { |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | + * 初始化数据库 | |
| 37 | + * | |
| 38 | + * @param context | |
| 39 | + * @param uid | |
| 40 | + */ | |
| 41 | + public static void initCollDataBase(Context context, String uid) { | |
| 42 | + if (null == getCollUserStepData(context, uid)) { | |
| 43 | + CollUserStepEntity entity = new CollUserStepEntity(); | |
| 44 | + entity.setUserId(uid); | |
| 45 | + insertCollStepData(context, entity); | |
| 46 | + } | |
| 47 | + | |
| 48 | + } | |
| 49 | + | |
| 50 | + | |
| 51 | + /** | |
| 36 | 52 | * 设置开始起点坐标 |
| 37 | 53 | * |
| 38 | 54 | * @param context | ... | ... |