mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-06-05 21:59:19 +02:00
adding a widget null check
This commit is contained in:
@@ -830,7 +830,8 @@ fun Context.deleteMediumWithPath(path: String) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun Context.updateWidgets() {
|
fun Context.updateWidgets() {
|
||||||
val widgetIDs = AppWidgetManager.getInstance(applicationContext)?.getAppWidgetIds(ComponentName(applicationContext, MyWidgetProvider::class.java)) ?: return
|
val widgetIDs = AppWidgetManager.getInstance(applicationContext)?.getAppWidgetIds(ComponentName(applicationContext, MyWidgetProvider::class.java))
|
||||||
|
?: return
|
||||||
if (widgetIDs.isNotEmpty()) {
|
if (widgetIDs.isNotEmpty()) {
|
||||||
Intent(applicationContext, MyWidgetProvider::class.java).apply {
|
Intent(applicationContext, MyWidgetProvider::class.java).apply {
|
||||||
action = AppWidgetManager.ACTION_APPWIDGET_UPDATE
|
action = AppWidgetManager.ACTION_APPWIDGET_UPDATE
|
||||||
|
Reference in New Issue
Block a user