Skip to content

Commit fe0d2ef

Browse files
committed
Attempt to really really stop the service when logging stops, using stopSelf().
Apparently using stopForeground isn't enough. That just removes the foreground state. To stop the service, it's stopSelf() that needs to be used. https://developer.android.com/reference/android/app/Service#stopForeground(int) Issue #933
1 parent e952181 commit fe0d2ef

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

gpslogger/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ android {
4545
targetSdkVersion 30
4646

4747
versionCode 122
48-
versionName "122-rc1"
48+
versionName "122-rc2"
4949
}
5050

5151
buildTypes {

gpslogger/src/main/java/com/mendhak/gpslogger/GpsLoggingService.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,7 @@ public void stopLogging() {
457457
session.setCurrentLocationInfo(null);
458458
session.setSinglePointMode(false);
459459
stopForeground(true);
460+
stopSelf();
460461

461462
removeNotification();
462463
stopAlarm();

0 commit comments

Comments
 (0)