Skip to content

Commit

Permalink
change to enqueueUpdate calls
Browse files Browse the repository at this point in the history
  • Loading branch information
j4velin committed Jul 1, 2019
1 parent 424d395 commit 9a89042
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/main/java/de/j4velin/pedometer/SensorListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ private boolean updateIfNecessary() {
lastSaveSteps = steps;
lastSaveTime = System.currentTimeMillis();
showNotification(); // update notification
startService(new Intent(this, WidgetUpdateService.class));
WidgetUpdateService.enqueueUpdate(this);
return true;
} else {
return false;
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/de/j4velin/pedometer/widget/WidgetConfig.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*
* Copyright 2014 Thomas Hoffmann
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down Expand Up @@ -36,7 +36,7 @@ public class WidgetConfig extends Activity implements OnClickListener {
@Override
protected void onPause() {
super.onPause();
startService(new Intent(this, WidgetUpdateService.class));
WidgetUpdateService.enqueueUpdate(this);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class WidgetUpdateService extends JobIntentService {

private static final int JOB_ID = 42;

static void enqueueUpdate(Context context) {
public static void enqueueUpdate(Context context) {
enqueueWork(context, WidgetUpdateService.class, JOB_ID, new Intent());
}

Expand Down

0 comments on commit 9a89042

Please sign in to comment.