Use ServiceCompat.stopForeground().

This commit is contained in:
Isira Seneviratne 2020-12-19 16:52:17 +05:30
parent 467dacd35a
commit 0fe3fe7594
5 changed files with 11 additions and 6 deletions

View file

@ -25,6 +25,7 @@ import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.content.res.AppCompatResources;
import androidx.core.app.NotificationCompat;
import androidx.core.app.ServiceCompat;
import androidx.core.widget.TextViewCompat;
import androidx.fragment.app.FragmentManager;
import androidx.preference.PreferenceManager;
@ -695,7 +696,7 @@ public class RouterActivity extends AppCompatActivity {
@Override
public void onDestroy() {
super.onDestroy();
stopForeground(true);
ServiceCompat.stopForeground(this, ServiceCompat.STOP_FOREGROUND_REMOVE);
if (fetcher != null) {
fetcher.dispose();
}