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