Skip to content

Commit 9a89042

Browse files
committed
change to enqueueUpdate calls
1 parent 424d395 commit 9a89042

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/main/java/de/j4velin/pedometer/SensorListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ private boolean updateIfNecessary() {
108108
lastSaveSteps = steps;
109109
lastSaveTime = System.currentTimeMillis();
110110
showNotification(); // update notification
111-
startService(new Intent(this, WidgetUpdateService.class));
111+
WidgetUpdateService.enqueueUpdate(this);
112112
return true;
113113
} else {
114114
return false;

src/main/java/de/j4velin/pedometer/widget/WidgetConfig.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/*
22
* Copyright 2014 Thomas Hoffmann
3-
*
3+
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
7-
*
7+
*
88
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
9+
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -36,7 +36,7 @@ public class WidgetConfig extends Activity implements OnClickListener {
3636
@Override
3737
protected void onPause() {
3838
super.onPause();
39-
startService(new Intent(this, WidgetUpdateService.class));
39+
WidgetUpdateService.enqueueUpdate(this);
4040
}
4141

4242
@Override

src/main/java/de/j4velin/pedometer/widget/WidgetUpdateService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class WidgetUpdateService extends JobIntentService {
3030

3131
private static final int JOB_ID = 42;
3232

33-
static void enqueueUpdate(Context context) {
33+
public static void enqueueUpdate(Context context) {
3434
enqueueWork(context, WidgetUpdateService.class, JOB_ID, new Intent());
3535
}
3636

0 commit comments

Comments
 (0)