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(); }