From 4ecc5f5f376bf86ac521c892d6712b52faffa3d6 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 21 Feb 2017 20:50:18 +0100 Subject: [PATCH] fix #84, allow changing widget months if the calendar app is killed --- .../calendar/helpers/MyWidgetMonthlyProvider.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/MyWidgetMonthlyProvider.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/MyWidgetMonthlyProvider.kt index a07e7850c..c499c3a10 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/MyWidgetMonthlyProvider.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/MyWidgetMonthlyProvider.kt @@ -99,6 +99,10 @@ class MyWidgetMonthlyProvider : AppWidgetProvider(), MonthlyCalendar { override fun onReceive(context: Context, intent: Intent) { val action = intent.action + if (mCalendar == null) { + initVariables(context) + } + when (action) { PREV -> mCalendar?.getPrevMonth() NEXT -> mCalendar?.getNextMonth()