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

Commit

Permalink
stopForeground service onTaskRemoved in MusicControlNotification (#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
roffelund authored and Guichaguri committed Jan 10, 2019
1 parent 04032c1 commit c9cf35e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
package="com.tanguyantoine.react">

<application>
<service android:stopWithTask="false" android:name=".MusicControlNotification$NotificationService" />
<service android:stopWithTask="true" android:name=".MusicControlNotification$NotificationService" />
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ public void onTaskRemoved(Intent rootIntent) {
if(MusicControlModule.INSTANCE != null) {
MusicControlModule.INSTANCE.destroy();
}
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
stopForeground(true);
}
stopSelf(); // Stop the service as we won't need it anymore
}

Expand Down

0 comments on commit c9cf35e

Please sign in to comment.