Prevent Service crash

This commit is contained in:
Sylvain Berfini 2020-04-01 10:35:46 +02:00
parent ea39ea82e7
commit 4a2e31f16d

View file

@ -32,8 +32,8 @@ class CoreService : CoreService() {
Log.i("[Service] Created")
}
override fun onStartCommand(intent: Intent, flags: Int, startId: Int): Int {
if (intent.extras?.get("StartForeground") == true) {
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
if (intent?.extras?.get("StartForeground") == true) {
Log.i("[Service] Starting as foreground")
coreContext.notificationsManager.startForeground(this, true)
}