From b59d47572ce3b7936328cc9c985355eefe24faa5 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Tue, 30 Apr 2013 21:38:28 -0700 Subject: After leaving search activity, remove it from activity stack --- .../github/daneren2005/dsub/fragments/SelectDirectoryFragment.java | 4 ++++ .../src/github/daneren2005/dsub/fragments/SubsonicFragment.java | 7 +++++++ 2 files changed, 11 insertions(+) (limited to 'subsonic-android') diff --git a/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java index 04d4fc65..63c41546 100644 --- a/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java +++ b/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java @@ -25,6 +25,7 @@ import github.daneren2005.dsub.view.EntryAdapter; import java.util.List; import com.mobeta.android.dslv.*; import github.daneren2005.dsub.activity.DownloadActivity; +import github.daneren2005.dsub.activity.SearchActivity; import github.daneren2005.dsub.service.DownloadFile; import github.daneren2005.dsub.service.MusicService; import github.daneren2005.dsub.service.MusicServiceFactory; @@ -478,6 +479,9 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter } if (autoplay) { Util.startActivityWithoutTransition(context, DownloadActivity.class); + if(context instanceof SearchActivity) { + context.finish(); + } } else if (save) { Util.toast(context, context.getResources().getQuantityString(R.plurals.select_album_n_songs_downloading, songs.size(), songs.size())); diff --git a/subsonic-android/src/github/daneren2005/dsub/fragments/SubsonicFragment.java b/subsonic-android/src/github/daneren2005/dsub/fragments/SubsonicFragment.java index e1c8087b..09d0e5d5 100644 --- a/subsonic-android/src/github/daneren2005/dsub/fragments/SubsonicFragment.java +++ b/subsonic-android/src/github/daneren2005/dsub/fragments/SubsonicFragment.java @@ -42,6 +42,7 @@ import github.daneren2005.dsub.R; import github.daneren2005.dsub.activity.DownloadActivity; import github.daneren2005.dsub.activity.HelpActivity; import github.daneren2005.dsub.activity.MainActivity; +import github.daneren2005.dsub.activity.SearchActivity; import github.daneren2005.dsub.activity.SettingsActivity; import github.daneren2005.dsub.activity.SubsonicActivity; import github.daneren2005.dsub.domain.Artist; @@ -195,6 +196,9 @@ public class SubsonicFragment extends SherlockFragment { getDownloadService().clear(); getDownloadService().download(songs, false, true, true, false); Util.startActivityWithoutTransition(context, DownloadActivity.class); + if(context instanceof SearchActivity) { + context.finish(); + } break; case R.id.song_menu_play_next: getDownloadService().download(songs, false, false, true, false); @@ -488,6 +492,9 @@ public class SubsonicFragment extends SherlockFragment { downloadService.download(songs, save, autoplay, false, shuffle); if(!append) { Util.startActivityWithoutTransition(context, DownloadActivity.class); + if(context instanceof SearchActivity) { + context.finish(); + } } } else { -- cgit v1.2.3