diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2012-09-05 14:19:37 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2012-09-05 14:19:37 +0200 |
commit | 42a5641439e77364c6b16c275bc47b76cc95c206 (patch) | |
tree | c0348f607d562e6f228bc86081d72c2e1702b3a1 /src/de/danoeh/antennapod/receiver | |
parent | 8a76daeeaf09c657c19a33ec4fffd3ae975b3412 (diff) | |
download | AntennaPod-42a5641439e77364c6b16c275bc47b76cc95c206.zip |
Made sure that WidgetUpdateService is stopped if necessary
Diffstat (limited to 'src/de/danoeh/antennapod/receiver')
-rw-r--r-- | src/de/danoeh/antennapod/receiver/PlayerWidget.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/de/danoeh/antennapod/receiver/PlayerWidget.java b/src/de/danoeh/antennapod/receiver/PlayerWidget.java index 5eb1f8afe..b1029a239 100644 --- a/src/de/danoeh/antennapod/receiver/PlayerWidget.java +++ b/src/de/danoeh/antennapod/receiver/PlayerWidget.java @@ -11,25 +11,25 @@ import android.util.Log; public class PlayerWidget extends AppWidgetProvider { private static final String TAG = "PlayerWidget"; public static final String FORCE_WIDGET_UPDATE = "de.danoeh.antennapod.FORCE_WIDGET_UPDATE"; + public static final String STOP_WIDGET_UPDATE = "de.danoeh.antennapod.STOP_WIDGET_UPDATE"; @Override public void onReceive(Context context, Intent intent) { if (intent.getAction().equals(FORCE_WIDGET_UPDATE)) { startUpdate(context); + } else if (intent.getAction().equals(STOP_WIDGET_UPDATE)) { + stopUpdate(context); } } - - @Override public void onEnabled(Context context) { super.onEnabled(context); - if (AppConfig.DEBUG) Log.d(TAG, "Widget enabled"); + if (AppConfig.DEBUG) + Log.d(TAG, "Widget enabled"); } - - @Override public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { @@ -40,4 +40,8 @@ public class PlayerWidget extends AppWidgetProvider { context.startService(new Intent(context, PlayerWidgetService.class)); } + private void stopUpdate(Context context) { + context.stopService(new Intent(context, PlayerWidgetService.class)); + } + } |