14 lines
393 B
Kotlin
14 lines
393 B
Kotlin
package com.adlerosn.brasilfurfest.helper
|
|
|
|
import android.content.Context
|
|
import android.content.Intent
|
|
import android.os.Build
|
|
|
|
|
|
fun Context.startServiceForegroundCompat(i: Intent) = (
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
|
|
startForegroundService(i)
|
|
else
|
|
startService(i)
|
|
)!!
|