From e19a02c017309bb82bb57c7ce57bb2c4574f7e22 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 14 Feb 2016 20:02:35 +0100 Subject: [PATCH] update the widgets properly --- .../simplemobiletools/com/MyWidgetProvider.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/flashlight/simplemobiletools/com/MyWidgetProvider.java b/app/src/main/java/flashlight/simplemobiletools/com/MyWidgetProvider.java index b00fb10..441f355 100644 --- a/app/src/main/java/flashlight/simplemobiletools/com/MyWidgetProvider.java +++ b/app/src/main/java/flashlight/simplemobiletools/com/MyWidgetProvider.java @@ -51,13 +51,17 @@ public class MyWidgetProvider extends AppWidgetProvider implements MyCamera { @Override public void enableFlashlight() { remoteViews.setImageViewResource(R.id.toggle_btn, R.mipmap.flashlight_big_on); - widgetManager.updateAppWidget(widgetIds, remoteViews); + for (int widgetId : widgetIds) { + widgetManager.updateAppWidget(widgetId, remoteViews); + } } @Override public void disableFlashlight() { remoteViews.setImageViewResource(R.id.toggle_btn, R.mipmap.flashlight_big_off); - widgetManager.updateAppWidget(widgetIds, remoteViews); + for (int widgetId : widgetIds) { + widgetManager.updateAppWidget(widgetId, remoteViews); + } cameraImpl.releaseCamera(); }