mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-22 18:07:55 +00:00
startService throws if called when the app is in the background in Oreo
This commit is contained in:
parent
be6b108e64
commit
24e1a95e92
@ -399,7 +399,11 @@ public class BackgroundService extends Service {
|
||||
}
|
||||
}
|
||||
Intent serviceIntent = new Intent(c, BackgroundService.class);
|
||||
c.startService(serviceIntent);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
c.startForegroundService(serviceIntent);
|
||||
} else {
|
||||
c.startService(serviceIntent);
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user