Fix background service error
This commit is contained in:
parent
0ea55db4b1
commit
c389d50b09
.idea/caches
app
BIN
.idea/caches/build_file_checksums.ser
generated
BIN
.idea/caches/build_file_checksums.ser
generated
Binary file not shown.
@ -22,7 +22,7 @@ android {
|
||||
applicationId "com.tommasoberlose.anotherwidget"
|
||||
minSdkVersion 23
|
||||
targetSdkVersion 30
|
||||
versionCode 125
|
||||
versionCode 126
|
||||
versionName "2.2.2"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
@ -35,7 +35,6 @@ class UpdateCalendarService : Service() {
|
||||
companion object {
|
||||
const val CALENDAR_SYNC_NOTIFICATION_ID = 28468
|
||||
fun enqueueWork(context: Context) {
|
||||
context.startService(Intent(context, UpdateCalendarService::class.java))
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
||||
context.startForegroundService(Intent(context, UpdateCalendarService::class.java))
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user