Skip to content

Commit

Permalink
Attempt to really really stop the service when logging stops, using s…
Browse files Browse the repository at this point in the history
…topSelf().

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
  • Loading branch information
mendhak committed May 18, 2022
1 parent e952181 commit fe0d2ef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gpslogger/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ android {
targetSdkVersion 30

versionCode 122
versionName "122-rc1"
versionName "122-rc2"
}

buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ public void stopLogging() {
session.setCurrentLocationInfo(null);
session.setSinglePointMode(false);
stopForeground(true);
stopSelf();

removeNotification();
stopAlarm();
Expand Down

0 comments on commit fe0d2ef

Please sign in to comment.