make sure the widget gets updated when the time/timezone or alarm changes

This commit is contained in:
tibbi 2018-03-13 17:22:17 +01:00
parent 1c29b08ef7
commit 0626a9be26
2 changed files with 20 additions and 0 deletions

View File

@ -106,5 +106,13 @@
android:name="android.appwidget.provider"
android:resource="@xml/widget_date_time_info"/>
</receiver>
<receiver android:name=".receivers.UpdateWidgetReceiver">
<intent-filter>
<action android:name="android.intent.action.TIME_SET"/>
<action android:name="android.intent.action.TIMEZONE_CHANGED"/>
<action android:name="android.app.action.NEXT_ALARM_CLOCK_CHANGED"/>
</intent-filter>
</receiver>
</application>
</manifest>

View File

@ -0,0 +1,12 @@
package com.simplemobiletools.clock.receivers
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import com.simplemobiletools.clock.extensions.updateWidgets
class UpdateWidgetReceiver : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
context.updateWidgets()
}
}