mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-23 10:27:57 +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);
|
Intent serviceIntent = new Intent(c, BackgroundService.class);
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
c.startForegroundService(serviceIntent);
|
||||||
|
} else {
|
||||||
c.startService(serviceIntent);
|
c.startService(serviceIntent);
|
||||||
|
}
|
||||||
}).start();
|
}).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user