try getting a reference to the db before doing any operations on it

This commit is contained in:
tibbi 2018-05-01 19:36:11 +02:00
parent e43516d02a
commit 60747821f1
2 changed files with 5 additions and 1 deletions

View file

@ -3,6 +3,7 @@ package com.simplemobiletools.calendar.receivers
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import com.simplemobiletools.calendar.extensions.dbHelper
import com.simplemobiletools.calendar.extensions.notifyRunningEvents
import com.simplemobiletools.calendar.extensions.recheckCalDAVCalendars
import com.simplemobiletools.calendar.extensions.scheduleAllEvents
@ -10,6 +11,9 @@ import com.simplemobiletools.calendar.extensions.scheduleAllEvents
class BootCompletedReceiver : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
// try just getting a reference to the db so it updates in time
context.dbHelper
Thread {
context.apply {
scheduleAllEvents()

View file

@ -9,7 +9,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
classpath 'com.android.tools.build:gradle:3.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong