Skip to content
This repository was archived by the owner on Oct 6, 2022. It is now read-only.

Commit 55ce2c2

Browse files
roffelundtanguyantoine
authored andcommitted
CloseForegroundService onDestroy (#254)
1 parent 2972665 commit 55ce2c2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

android/src/main/java/com/tanguyantoine/react/MusicControlNotification.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,11 @@ public void onTaskRemoved(Intent rootIntent) {
208208
stopSelf(); // Stop the service as we won't need it anymore
209209
}
210210

211+
@Override
212+
public void onDestroy() {
213+
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
214+
stopForeground(true);
215+
}
216+
}
211217
}
212-
213218
}

0 commit comments

Comments
 (0)