aboutsummaryrefslogtreecommitdiff
path: root/subsonic-android
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2013-05-13 20:09:53 -0700
committerScott Jackson <daneren2005@gmail.com>2013-05-13 20:09:53 -0700
commitb77377ad3d787f9b25a9f2259780b0cf0e80cf33 (patch)
tree50e3a99663d60334c2fb0209ed7b51a1c71061ad /subsonic-android
parent5dd0affb0e401d32b7c782f65a25f9fc4244608a (diff)
downloaddsub-b77377ad3d787f9b25a9f2259780b0cf0e80cf33.tar.gz
dsub-b77377ad3d787f9b25a9f2259780b0cf0e80cf33.tar.bz2
dsub-b77377ad3d787f9b25a9f2259780b0cf0e80cf33.zip
Keep main activity on backstack when clicking widget
Diffstat (limited to 'subsonic-android')
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/provider/DSubWidgetProvider.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/provider/DSubWidgetProvider.java b/subsonic-android/src/github/daneren2005/dsub/provider/DSubWidgetProvider.java
index 021868b9..c61e215a 100644
--- a/subsonic-android/src/github/daneren2005/dsub/provider/DSubWidgetProvider.java
+++ b/subsonic-android/src/github/daneren2005/dsub/provider/DSubWidgetProvider.java
@@ -211,8 +211,11 @@ public class DSubWidgetProvider extends AppWidgetProvider {
* otherwise we launch {@link MainActivity}.
*/
private void linkButtons(Context context, RemoteViews views, boolean playerActive) {
-
- Intent intent = new Intent(context, playerActive ? DownloadActivity.class : MainActivity.class);
+ Intent intent = new Intent(context, MainActivity.class);
+ if(playerActive) {
+ intent.putExtra(Constants.INTENT_EXTRA_NAME_DOWNLOAD, true);
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
+ }
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);
views.setOnClickPendingIntent(R.id.appwidget_coverart, pendingIntent);
views.setOnClickPendingIntent(R.id.appwidget_top, pendingIntent);