diff --git a/src/ch/blinkenlights/android/vanilla/FourLongWidget.java b/src/ch/blinkenlights/android/vanilla/FourLongWidget.java index 48501fb4..555e29c3 100644 --- a/src/ch/blinkenlights/android/vanilla/FourLongWidget.java +++ b/src/ch/blinkenlights/android/vanilla/FourLongWidget.java @@ -130,11 +130,11 @@ public class FourLongWidget extends AppWidgetProvider { views.setOnClickPendingIntent(R.id.cover, pendingIntent); views.setOnClickPendingIntent(R.id.text_layout, pendingIntent); - intent = new Intent(context, ShortcutPseudoActivity.class).setFlags(flags).setAction(PlaybackService.ACTION_TOGGLE_PLAYBACK); + intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_TOGGLE_PLAYBACK); pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); views.setOnClickPendingIntent(R.id.play_pause, pendingIntent); - intent = new Intent(context, ShortcutPseudoActivity.class).setFlags(flags).setAction(PlaybackService.ACTION_NEXT_SONG); + intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_NEXT_SONG); pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); views.setOnClickPendingIntent(R.id.next, pendingIntent); diff --git a/src/ch/blinkenlights/android/vanilla/FourSquareWidget.java b/src/ch/blinkenlights/android/vanilla/FourSquareWidget.java index f7718405..b34068de 100644 --- a/src/ch/blinkenlights/android/vanilla/FourSquareWidget.java +++ b/src/ch/blinkenlights/android/vanilla/FourSquareWidget.java @@ -133,11 +133,11 @@ public class FourSquareWidget extends AppWidgetProvider { views.setOnClickPendingIntent(R.id.title, pendingIntent); views.setOnClickPendingIntent(R.id.artist, pendingIntent); - intent = new Intent(context, ShortcutPseudoActivity.class).setFlags(flags).setAction(PlaybackService.ACTION_TOGGLE_PLAYBACK); + intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_TOGGLE_PLAYBACK); pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); views.setOnClickPendingIntent(R.id.play_pause, pendingIntent); - intent = new Intent(context, ShortcutPseudoActivity.class).setFlags(flags).setAction(PlaybackService.ACTION_NEXT_SONG); + intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_NEXT_SONG); pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); views.setOnClickPendingIntent(R.id.next, pendingIntent); diff --git a/src/ch/blinkenlights/android/vanilla/FourWhiteWidget.java b/src/ch/blinkenlights/android/vanilla/FourWhiteWidget.java index b5f0ef19..f94147c0 100644 --- a/src/ch/blinkenlights/android/vanilla/FourWhiteWidget.java +++ b/src/ch/blinkenlights/android/vanilla/FourWhiteWidget.java @@ -135,15 +135,15 @@ public class FourWhiteWidget extends AppWidgetProvider { views.setOnClickPendingIntent(R.id.cover, pendingIntent); views.setOnClickPendingIntent(R.id.text_layout, pendingIntent); - intent = new Intent(context, ShortcutPseudoActivity.class).setFlags(flags).setAction(PlaybackService.ACTION_TOGGLE_PLAYBACK); + intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_TOGGLE_PLAYBACK); pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); views.setOnClickPendingIntent(R.id.play_pause, pendingIntent); - intent = new Intent(context, ShortcutPseudoActivity.class).setFlags(flags).setAction(PlaybackService.ACTION_NEXT_SONG); + intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_NEXT_SONG); pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); views.setOnClickPendingIntent(R.id.next, pendingIntent); - intent = new Intent(context, ShortcutPseudoActivity.class).setFlags(flags).setAction(PlaybackService.ACTION_PREVIOUS_SONG); + intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_PREVIOUS_SONG); pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); views.setOnClickPendingIntent(R.id.previous, pendingIntent); diff --git a/src/ch/blinkenlights/android/vanilla/OneCellWidget.java b/src/ch/blinkenlights/android/vanilla/OneCellWidget.java index 9bd85ad3..7f8a1aaf 100644 --- a/src/ch/blinkenlights/android/vanilla/OneCellWidget.java +++ b/src/ch/blinkenlights/android/vanilla/OneCellWidget.java @@ -102,11 +102,11 @@ public class OneCellWidget extends AppWidgetProvider { PendingIntent pendingIntent; int flags = Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_TASK_ON_HOME; - intent = new Intent(context, ShortcutPseudoActivity.class).setFlags(flags).setAction(doubleTap ? PlaybackService.ACTION_TOGGLE_PLAYBACK_DELAYED : PlaybackService.ACTION_TOGGLE_PLAYBACK); + intent = ShortcutPseudoActivity.getIntent(context, doubleTap ? PlaybackService.ACTION_TOGGLE_PLAYBACK_DELAYED : PlaybackService.ACTION_TOGGLE_PLAYBACK); pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); views.setOnClickPendingIntent(R.id.play_pause, pendingIntent); - intent = new Intent(context, ShortcutPseudoActivity.class).setFlags(flags).setAction(doubleTap ? PlaybackService.ACTION_NEXT_SONG_DELAYED : PlaybackService.ACTION_NEXT_SONG); + intent = ShortcutPseudoActivity.getIntent(context, doubleTap ? PlaybackService.ACTION_NEXT_SONG_DELAYED : PlaybackService.ACTION_NEXT_SONG); pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); views.setOnClickPendingIntent(R.id.next, pendingIntent); diff --git a/src/ch/blinkenlights/android/vanilla/WidgetD.java b/src/ch/blinkenlights/android/vanilla/WidgetD.java index 1da7173d..e721d7ec 100644 --- a/src/ch/blinkenlights/android/vanilla/WidgetD.java +++ b/src/ch/blinkenlights/android/vanilla/WidgetD.java @@ -127,23 +127,23 @@ public class WidgetD extends AppWidgetProvider { pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); views.setOnClickPendingIntent(R.id.cover, pendingIntent); - intent = new Intent(context, ShortcutPseudoActivity.class).setFlags(flags).setAction(PlaybackService.ACTION_TOGGLE_PLAYBACK); + intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_TOGGLE_PLAYBACK); pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); views.setOnClickPendingIntent(R.id.play_pause, pendingIntent); - intent = new Intent(context, ShortcutPseudoActivity.class).setFlags(flags).setAction(PlaybackService.ACTION_NEXT_SONG); + intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_NEXT_SONG); pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); views.setOnClickPendingIntent(R.id.next, pendingIntent); - intent = new Intent(context, ShortcutPseudoActivity.class).setFlags(flags).setAction(PlaybackService.ACTION_PREVIOUS_SONG); + intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_PREVIOUS_SONG); pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); views.setOnClickPendingIntent(R.id.previous, pendingIntent); - intent = new Intent(context, ShortcutPseudoActivity.class).setFlags(flags).setAction(PlaybackService.ACTION_CYCLE_SHUFFLE); + intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_CYCLE_SHUFFLE); pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); views.setOnClickPendingIntent(R.id.shuffle, pendingIntent); - intent = new Intent(context, ShortcutPseudoActivity.class).setFlags(flags).setAction(PlaybackService.ACTION_CYCLE_REPEAT); + intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_CYCLE_REPEAT); pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); views.setOnClickPendingIntent(R.id.end_action, pendingIntent); diff --git a/src/ch/blinkenlights/android/vanilla/WidgetE.java b/src/ch/blinkenlights/android/vanilla/WidgetE.java index 119e5894..2ac5d1bd 100644 --- a/src/ch/blinkenlights/android/vanilla/WidgetE.java +++ b/src/ch/blinkenlights/android/vanilla/WidgetE.java @@ -118,23 +118,23 @@ public class WidgetE extends AppWidgetProvider { views.setOnClickPendingIntent(R.id.title, pendingIntent); views.setOnClickPendingIntent(R.id.artist, pendingIntent); - intent = new Intent(context, ShortcutPseudoActivity.class).setFlags(flags).setAction(PlaybackService.ACTION_TOGGLE_PLAYBACK); + intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_TOGGLE_PLAYBACK); pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); views.setOnClickPendingIntent(R.id.play_pause, pendingIntent); - intent = new Intent(context, ShortcutPseudoActivity.class).setFlags(flags).setAction(PlaybackService.ACTION_NEXT_SONG); + intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_NEXT_SONG); pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); views.setOnClickPendingIntent(R.id.next, pendingIntent); - intent = new Intent(context, ShortcutPseudoActivity.class).setFlags(flags).setAction(PlaybackService.ACTION_PREVIOUS_SONG); + intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_PREVIOUS_SONG); pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); views.setOnClickPendingIntent(R.id.previous, pendingIntent); - intent = new Intent(context, ShortcutPseudoActivity.class).setFlags(flags).setAction(PlaybackService.ACTION_CYCLE_SHUFFLE); + intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_CYCLE_SHUFFLE); pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); views.setOnClickPendingIntent(R.id.shuffle, pendingIntent); - intent = new Intent(context, ShortcutPseudoActivity.class).setFlags(flags).setAction(PlaybackService.ACTION_CYCLE_REPEAT); + intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_CYCLE_REPEAT); pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); views.setOnClickPendingIntent(R.id.end_action, pendingIntent);