aboutsummaryrefslogtreecommitdiff
path: root/src/github/daneren2005/dsub/provider/DSubWidgetProvider.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/github/daneren2005/dsub/provider/DSubWidgetProvider.java')
-rw-r--r--src/github/daneren2005/dsub/provider/DSubWidgetProvider.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/github/daneren2005/dsub/provider/DSubWidgetProvider.java b/src/github/daneren2005/dsub/provider/DSubWidgetProvider.java
index f6b28b21..f4c3656c 100644
--- a/src/github/daneren2005/dsub/provider/DSubWidgetProvider.java
+++ b/src/github/daneren2005/dsub/provider/DSubWidgetProvider.java
@@ -286,19 +286,19 @@ public class DSubWidgetProvider extends AppWidgetProvider {
// Emulate media button clicks.
intent = new Intent("DSub.PLAY_PAUSE");
intent.setComponent(new ComponentName(context, DownloadService.class));
- intent.putExtra(Intent.EXTRA_KEY_EVENT, new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE));
+ intent.setAction(DownloadService.CMD_TOGGLEPAUSE);
pendingIntent = PendingIntent.getService(context, 0, intent, 0);
views.setOnClickPendingIntent(R.id.control_play, pendingIntent);
intent = new Intent("DSub.NEXT"); // Use a unique action name to ensure a different PendingIntent to be created.
intent.setComponent(new ComponentName(context, DownloadService.class));
- intent.putExtra(Intent.EXTRA_KEY_EVENT, new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_MEDIA_NEXT));
+ intent.setAction(DownloadService.CMD_NEXT);
pendingIntent = PendingIntent.getService(context, 0, intent, 0);
views.setOnClickPendingIntent(R.id.control_next, pendingIntent);
intent = new Intent("DSub.PREVIOUS"); // Use a unique action name to ensure a different PendingIntent to be created.
intent.setComponent(new ComponentName(context, DownloadService.class));
- intent.putExtra(Intent.EXTRA_KEY_EVENT, new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_MEDIA_PREVIOUS));
+ intent.setAction(DownloadService.CMD_PREVIOUS);
pendingIntent = PendingIntent.getService(context, 0, intent, 0);
views.setOnClickPendingIntent(R.id.control_previous, pendingIntent);
}